1#![doc = "MAVLink matrixpilot dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#![allow(clippy::match_single_binding)]
6#[cfg(feature = "arbitrary")]
7use arbitrary::Arbitrary;
8#[allow(unused_imports)]
9use bitflags::{bitflags, Flags};
10#[allow(unused_imports)]
11use mavlink_core::{
12 bytes::Bytes, bytes_mut::BytesMut, types::CharArray, MavlinkVersion, Message, MessageData,
13};
14#[allow(unused_imports)]
15use num_derive::{FromPrimitive, ToPrimitive};
16#[allow(unused_imports)]
17use num_traits::{FromPrimitive, ToPrimitive};
18#[cfg(feature = "serde")]
19use serde::{Deserialize, Serialize};
20#[cfg(feature = "ts")]
21use ts_rs::TS;
22pub const MINOR_MAVLINK_VERSION: u8 = 3u8;
23#[cfg_attr(feature = "ts", derive(TS))]
24#[cfg_attr(feature = "ts", ts(export))]
25#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
26#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27#[cfg_attr(feature = "serde", serde(tag = "type"))]
28#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29#[repr(u32)]
30#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
31pub enum ActuatorConfiguration {
32 #[doc = "Do nothing."]
33 ACTUATOR_CONFIGURATION_NONE = 0,
34 #[doc = "Command the actuator to beep now."]
35 ACTUATOR_CONFIGURATION_BEEP = 1,
36 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
37 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
38 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
39 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
40 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
41 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
42 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
43 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
44}
45impl ActuatorConfiguration {
46 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
47}
48impl Default for ActuatorConfiguration {
49 fn default() -> Self {
50 Self::DEFAULT
51 }
52}
53#[cfg_attr(feature = "ts", derive(TS))]
54#[cfg_attr(feature = "ts", ts(export))]
55#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
56#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
57#[cfg_attr(feature = "serde", serde(tag = "type"))]
58#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
59#[repr(u32)]
60#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
61pub enum ActuatorOutputFunction {
62 #[doc = "No function (disabled)."]
63 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
64 #[doc = "Motor 1"]
65 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
66 #[doc = "Motor 2"]
67 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
68 #[doc = "Motor 3"]
69 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
70 #[doc = "Motor 4"]
71 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
72 #[doc = "Motor 5"]
73 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
74 #[doc = "Motor 6"]
75 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
76 #[doc = "Motor 7"]
77 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
78 #[doc = "Motor 8"]
79 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
80 #[doc = "Motor 9"]
81 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
82 #[doc = "Motor 10"]
83 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
84 #[doc = "Motor 11"]
85 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
86 #[doc = "Motor 12"]
87 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
88 #[doc = "Motor 13"]
89 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
90 #[doc = "Motor 14"]
91 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
92 #[doc = "Motor 15"]
93 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
94 #[doc = "Motor 16"]
95 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
96 #[doc = "Servo 1"]
97 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
98 #[doc = "Servo 2"]
99 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
100 #[doc = "Servo 3"]
101 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
102 #[doc = "Servo 4"]
103 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
104 #[doc = "Servo 5"]
105 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
106 #[doc = "Servo 6"]
107 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
108 #[doc = "Servo 7"]
109 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
110 #[doc = "Servo 8"]
111 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
112 #[doc = "Servo 9"]
113 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
114 #[doc = "Servo 10"]
115 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
116 #[doc = "Servo 11"]
117 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
118 #[doc = "Servo 12"]
119 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
120 #[doc = "Servo 13"]
121 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
122 #[doc = "Servo 14"]
123 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
124 #[doc = "Servo 15"]
125 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
126 #[doc = "Servo 16"]
127 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
128}
129impl ActuatorOutputFunction {
130 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
131}
132impl Default for ActuatorOutputFunction {
133 fn default() -> Self {
134 Self::DEFAULT
135 }
136}
137#[cfg_attr(feature = "ts", derive(TS))]
138#[cfg_attr(feature = "ts", ts(export))]
139#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
140#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
141#[cfg_attr(feature = "serde", serde(tag = "type"))]
142#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
143#[repr(u32)]
144#[doc = "Enumeration of the ADSB altimeter types"]
145pub enum AdsbAltitudeType {
146 #[doc = "Altitude reported from a Baro source using QNH reference"]
147 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
148 #[doc = "Altitude reported from a GNSS source"]
149 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
150}
151impl AdsbAltitudeType {
152 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
153}
154impl Default for AdsbAltitudeType {
155 fn default() -> Self {
156 Self::DEFAULT
157 }
158}
159#[cfg_attr(feature = "ts", derive(TS))]
160#[cfg_attr(feature = "ts", ts(export))]
161#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
162#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
163#[cfg_attr(feature = "serde", serde(tag = "type"))]
164#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
165#[repr(u32)]
166#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
167pub enum AdsbEmitterType {
168 ADSB_EMITTER_TYPE_NO_INFO = 0,
169 ADSB_EMITTER_TYPE_LIGHT = 1,
170 ADSB_EMITTER_TYPE_SMALL = 2,
171 ADSB_EMITTER_TYPE_LARGE = 3,
172 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
173 ADSB_EMITTER_TYPE_HEAVY = 5,
174 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
175 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
176 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
177 ADSB_EMITTER_TYPE_GLIDER = 9,
178 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
179 ADSB_EMITTER_TYPE_PARACHUTE = 11,
180 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
181 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
182 ADSB_EMITTER_TYPE_UAV = 14,
183 ADSB_EMITTER_TYPE_SPACE = 15,
184 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
185 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
186 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
187 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
188}
189impl AdsbEmitterType {
190 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
191}
192impl Default for AdsbEmitterType {
193 fn default() -> Self {
194 Self::DEFAULT
195 }
196}
197bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
198impl AdsbFlags {
199 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
200}
201impl Default for AdsbFlags {
202 fn default() -> Self {
203 Self::DEFAULT
204 }
205}
206bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
207impl AisFlags {
208 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
209}
210impl Default for AisFlags {
211 fn default() -> Self {
212 Self::DEFAULT
213 }
214}
215#[cfg_attr(feature = "ts", derive(TS))]
216#[cfg_attr(feature = "ts", ts(export))]
217#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
218#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
219#[cfg_attr(feature = "serde", serde(tag = "type"))]
220#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
221#[repr(u32)]
222#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
223pub enum AisNavStatus {
224 #[doc = "Under way using engine."]
225 UNDER_WAY = 0,
226 AIS_NAV_ANCHORED = 1,
227 AIS_NAV_UN_COMMANDED = 2,
228 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
229 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
230 AIS_NAV_MOORED = 5,
231 AIS_NAV_AGROUND = 6,
232 AIS_NAV_FISHING = 7,
233 AIS_NAV_SAILING = 8,
234 AIS_NAV_RESERVED_HSC = 9,
235 AIS_NAV_RESERVED_WIG = 10,
236 AIS_NAV_RESERVED_1 = 11,
237 AIS_NAV_RESERVED_2 = 12,
238 AIS_NAV_RESERVED_3 = 13,
239 #[doc = "Search And Rescue Transponder."]
240 AIS_NAV_AIS_SART = 14,
241 #[doc = "Not available (default)."]
242 AIS_NAV_UNKNOWN = 15,
243}
244impl AisNavStatus {
245 pub const DEFAULT: Self = Self::UNDER_WAY;
246}
247impl Default for AisNavStatus {
248 fn default() -> Self {
249 Self::DEFAULT
250 }
251}
252#[cfg_attr(feature = "ts", derive(TS))]
253#[cfg_attr(feature = "ts", ts(export))]
254#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
256#[cfg_attr(feature = "serde", serde(tag = "type"))]
257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
258#[repr(u32)]
259#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
260pub enum AisType {
261 #[doc = "Not available (default)."]
262 AIS_TYPE_UNKNOWN = 0,
263 AIS_TYPE_RESERVED_1 = 1,
264 AIS_TYPE_RESERVED_2 = 2,
265 AIS_TYPE_RESERVED_3 = 3,
266 AIS_TYPE_RESERVED_4 = 4,
267 AIS_TYPE_RESERVED_5 = 5,
268 AIS_TYPE_RESERVED_6 = 6,
269 AIS_TYPE_RESERVED_7 = 7,
270 AIS_TYPE_RESERVED_8 = 8,
271 AIS_TYPE_RESERVED_9 = 9,
272 AIS_TYPE_RESERVED_10 = 10,
273 AIS_TYPE_RESERVED_11 = 11,
274 AIS_TYPE_RESERVED_12 = 12,
275 AIS_TYPE_RESERVED_13 = 13,
276 AIS_TYPE_RESERVED_14 = 14,
277 AIS_TYPE_RESERVED_15 = 15,
278 AIS_TYPE_RESERVED_16 = 16,
279 AIS_TYPE_RESERVED_17 = 17,
280 AIS_TYPE_RESERVED_18 = 18,
281 AIS_TYPE_RESERVED_19 = 19,
282 #[doc = "Wing In Ground effect."]
283 AIS_TYPE_WIG = 20,
284 AIS_TYPE_WIG_HAZARDOUS_A = 21,
285 AIS_TYPE_WIG_HAZARDOUS_B = 22,
286 AIS_TYPE_WIG_HAZARDOUS_C = 23,
287 AIS_TYPE_WIG_HAZARDOUS_D = 24,
288 AIS_TYPE_WIG_RESERVED_1 = 25,
289 AIS_TYPE_WIG_RESERVED_2 = 26,
290 AIS_TYPE_WIG_RESERVED_3 = 27,
291 AIS_TYPE_WIG_RESERVED_4 = 28,
292 AIS_TYPE_WIG_RESERVED_5 = 29,
293 AIS_TYPE_FISHING = 30,
294 AIS_TYPE_TOWING = 31,
295 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
296 AIS_TYPE_TOWING_LARGE = 32,
297 #[doc = "Dredging or other underwater ops."]
298 AIS_TYPE_DREDGING = 33,
299 AIS_TYPE_DIVING = 34,
300 AIS_TYPE_MILITARY = 35,
301 AIS_TYPE_SAILING = 36,
302 AIS_TYPE_PLEASURE = 37,
303 AIS_TYPE_RESERVED_20 = 38,
304 AIS_TYPE_RESERVED_21 = 39,
305 #[doc = "High Speed Craft."]
306 AIS_TYPE_HSC = 40,
307 AIS_TYPE_HSC_HAZARDOUS_A = 41,
308 AIS_TYPE_HSC_HAZARDOUS_B = 42,
309 AIS_TYPE_HSC_HAZARDOUS_C = 43,
310 AIS_TYPE_HSC_HAZARDOUS_D = 44,
311 AIS_TYPE_HSC_RESERVED_1 = 45,
312 AIS_TYPE_HSC_RESERVED_2 = 46,
313 AIS_TYPE_HSC_RESERVED_3 = 47,
314 AIS_TYPE_HSC_RESERVED_4 = 48,
315 AIS_TYPE_HSC_UNKNOWN = 49,
316 AIS_TYPE_PILOT = 50,
317 #[doc = "Search And Rescue vessel."]
318 AIS_TYPE_SAR = 51,
319 AIS_TYPE_TUG = 52,
320 AIS_TYPE_PORT_TENDER = 53,
321 #[doc = "Anti-pollution equipment."]
322 AIS_TYPE_ANTI_POLLUTION = 54,
323 AIS_TYPE_LAW_ENFORCEMENT = 55,
324 AIS_TYPE_SPARE_LOCAL_1 = 56,
325 AIS_TYPE_SPARE_LOCAL_2 = 57,
326 AIS_TYPE_MEDICAL_TRANSPORT = 58,
327 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
328 AIS_TYPE_NONECOMBATANT = 59,
329 AIS_TYPE_PASSENGER = 60,
330 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
331 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
332 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
333 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
334 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
335 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
336 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
337 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
338 AIS_TYPE_PASSENGER_UNKNOWN = 69,
339 AIS_TYPE_CARGO = 70,
340 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
341 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
342 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
343 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
344 AIS_TYPE_CARGO_RESERVED_1 = 75,
345 AIS_TYPE_CARGO_RESERVED_2 = 76,
346 AIS_TYPE_CARGO_RESERVED_3 = 77,
347 AIS_TYPE_CARGO_RESERVED_4 = 78,
348 AIS_TYPE_CARGO_UNKNOWN = 79,
349 AIS_TYPE_TANKER = 80,
350 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
351 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
352 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
353 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
354 AIS_TYPE_TANKER_RESERVED_1 = 85,
355 AIS_TYPE_TANKER_RESERVED_2 = 86,
356 AIS_TYPE_TANKER_RESERVED_3 = 87,
357 AIS_TYPE_TANKER_RESERVED_4 = 88,
358 AIS_TYPE_TANKER_UNKNOWN = 89,
359 AIS_TYPE_OTHER = 90,
360 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
361 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
362 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
363 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
364 AIS_TYPE_OTHER_RESERVED_1 = 95,
365 AIS_TYPE_OTHER_RESERVED_2 = 96,
366 AIS_TYPE_OTHER_RESERVED_3 = 97,
367 AIS_TYPE_OTHER_RESERVED_4 = 98,
368 AIS_TYPE_OTHER_UNKNOWN = 99,
369}
370impl AisType {
371 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
372}
373impl Default for AisType {
374 fn default() -> Self {
375 Self::DEFAULT
376 }
377}
378bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
379impl AttitudeTargetTypemask {
380 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
381}
382impl Default for AttitudeTargetTypemask {
383 fn default() -> Self {
384 Self::DEFAULT
385 }
386}
387#[cfg_attr(feature = "ts", derive(TS))]
388#[cfg_attr(feature = "ts", ts(export))]
389#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
390#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
391#[cfg_attr(feature = "serde", serde(tag = "type"))]
392#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
393#[repr(u32)]
394#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
395pub enum AutotuneAxis {
396 #[doc = "Autotune roll axis."]
397 AUTOTUNE_AXIS_ROLL = 1,
398 #[doc = "Autotune pitch axis."]
399 AUTOTUNE_AXIS_PITCH = 2,
400 #[doc = "Autotune yaw axis."]
401 AUTOTUNE_AXIS_YAW = 4,
402}
403impl AutotuneAxis {
404 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
405}
406impl Default for AutotuneAxis {
407 fn default() -> Self {
408 Self::DEFAULT
409 }
410}
411bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
412impl CameraCapFlags {
413 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
414}
415impl Default for CameraCapFlags {
416 fn default() -> Self {
417 Self::DEFAULT
418 }
419}
420#[cfg_attr(feature = "ts", derive(TS))]
421#[cfg_attr(feature = "ts", ts(export))]
422#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
423#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
424#[cfg_attr(feature = "serde", serde(tag = "type"))]
425#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
426#[repr(u32)]
427#[doc = "Camera Modes."]
428pub enum CameraMode {
429 #[doc = "Camera is in image/photo capture mode."]
430 CAMERA_MODE_IMAGE = 0,
431 #[doc = "Camera is in video capture mode."]
432 CAMERA_MODE_VIDEO = 1,
433 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
434 CAMERA_MODE_IMAGE_SURVEY = 2,
435}
436impl CameraMode {
437 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
438}
439impl Default for CameraMode {
440 fn default() -> Self {
441 Self::DEFAULT
442 }
443}
444#[cfg_attr(feature = "ts", derive(TS))]
445#[cfg_attr(feature = "ts", ts(export))]
446#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
447#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
448#[cfg_attr(feature = "serde", serde(tag = "type"))]
449#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
450#[repr(u32)]
451#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
452pub enum CameraSource {
453 #[doc = "Default camera source."]
454 CAMERA_SOURCE_DEFAULT = 0,
455 #[doc = "RGB camera source."]
456 CAMERA_SOURCE_RGB = 1,
457 #[doc = "IR camera source."]
458 CAMERA_SOURCE_IR = 2,
459 #[doc = "NDVI camera source."]
460 CAMERA_SOURCE_NDVI = 3,
461}
462impl CameraSource {
463 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
464}
465impl Default for CameraSource {
466 fn default() -> Self {
467 Self::DEFAULT
468 }
469}
470#[cfg_attr(feature = "ts", derive(TS))]
471#[cfg_attr(feature = "ts", ts(export))]
472#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
473#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
474#[cfg_attr(feature = "serde", serde(tag = "type"))]
475#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
476#[repr(u32)]
477#[doc = "Camera tracking modes"]
478pub enum CameraTrackingMode {
479 #[doc = "Not tracking"]
480 CAMERA_TRACKING_MODE_NONE = 0,
481 #[doc = "Target is a point"]
482 CAMERA_TRACKING_MODE_POINT = 1,
483 #[doc = "Target is a rectangle"]
484 CAMERA_TRACKING_MODE_RECTANGLE = 2,
485}
486impl CameraTrackingMode {
487 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
488}
489impl Default for CameraTrackingMode {
490 fn default() -> Self {
491 Self::DEFAULT
492 }
493}
494#[cfg_attr(feature = "ts", derive(TS))]
495#[cfg_attr(feature = "ts", ts(export))]
496#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
497#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
498#[cfg_attr(feature = "serde", serde(tag = "type"))]
499#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
500#[repr(u32)]
501#[doc = "Camera tracking status flags"]
502pub enum CameraTrackingStatusFlags {
503 #[doc = "Camera is not tracking"]
504 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
505 #[doc = "Camera is tracking"]
506 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
507 #[doc = "Camera tracking in error state"]
508 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
509}
510impl CameraTrackingStatusFlags {
511 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
512}
513impl Default for CameraTrackingStatusFlags {
514 fn default() -> Self {
515 Self::DEFAULT
516 }
517}
518bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
519impl CameraTrackingTargetData {
520 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
521}
522impl Default for CameraTrackingTargetData {
523 fn default() -> Self {
524 Self::DEFAULT
525 }
526}
527#[cfg_attr(feature = "ts", derive(TS))]
528#[cfg_attr(feature = "ts", ts(export))]
529#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
531#[cfg_attr(feature = "serde", serde(tag = "type"))]
532#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
533#[repr(u32)]
534#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
535pub enum CameraZoomType {
536 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
537 ZOOM_TYPE_STEP = 0,
538 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
539 ZOOM_TYPE_CONTINUOUS = 1,
540 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
541 ZOOM_TYPE_RANGE = 2,
542 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
543 ZOOM_TYPE_FOCAL_LENGTH = 3,
544 #[doc = "Zoom value as horizontal field of view in degrees."]
545 ZOOM_TYPE_HORIZONTAL_FOV = 4,
546}
547impl CameraZoomType {
548 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
549}
550impl Default for CameraZoomType {
551 fn default() -> Self {
552 Self::DEFAULT
553 }
554}
555#[cfg_attr(feature = "ts", derive(TS))]
556#[cfg_attr(feature = "ts", ts(export))]
557#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
558#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
559#[cfg_attr(feature = "serde", serde(tag = "type"))]
560#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
561#[repr(u32)]
562pub enum CanFilterOp {
563 CAN_FILTER_REPLACE = 0,
564 CAN_FILTER_ADD = 1,
565 CAN_FILTER_REMOVE = 2,
566}
567impl CanFilterOp {
568 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
569}
570impl Default for CanFilterOp {
571 fn default() -> Self {
572 Self::DEFAULT
573 }
574}
575#[cfg_attr(feature = "ts", derive(TS))]
576#[cfg_attr(feature = "ts", ts(export))]
577#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
578#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
579#[cfg_attr(feature = "serde", serde(tag = "type"))]
580#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
581#[repr(u32)]
582#[doc = "Possible responses from a CELLULAR_CONFIG message."]
583pub enum CellularConfigResponse {
584 #[doc = "Changes accepted."]
585 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
586 #[doc = "Invalid APN."]
587 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
588 #[doc = "Invalid PIN."]
589 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
590 #[doc = "Changes rejected."]
591 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
592 #[doc = "PUK is required to unblock SIM card."]
593 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
594}
595impl CellularConfigResponse {
596 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
597}
598impl Default for CellularConfigResponse {
599 fn default() -> Self {
600 Self::DEFAULT
601 }
602}
603#[cfg_attr(feature = "ts", derive(TS))]
604#[cfg_attr(feature = "ts", ts(export))]
605#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
606#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
607#[cfg_attr(feature = "serde", serde(tag = "type"))]
608#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
609#[repr(u32)]
610#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
611pub enum CellularNetworkFailedReason {
612 #[doc = "No error"]
613 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
614 #[doc = "Error state is unknown"]
615 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
616 #[doc = "SIM is required for the modem but missing"]
617 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
618 #[doc = "SIM is available, but not usable for connection"]
619 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
620}
621impl CellularNetworkFailedReason {
622 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
623}
624impl Default for CellularNetworkFailedReason {
625 fn default() -> Self {
626 Self::DEFAULT
627 }
628}
629#[cfg_attr(feature = "ts", derive(TS))]
630#[cfg_attr(feature = "ts", ts(export))]
631#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
632#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
633#[cfg_attr(feature = "serde", serde(tag = "type"))]
634#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
635#[repr(u32)]
636#[doc = "Cellular network radio type"]
637pub enum CellularNetworkRadioType {
638 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
639 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
640 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
641 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
642 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
643}
644impl CellularNetworkRadioType {
645 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
646}
647impl Default for CellularNetworkRadioType {
648 fn default() -> Self {
649 Self::DEFAULT
650 }
651}
652#[cfg_attr(feature = "ts", derive(TS))]
653#[cfg_attr(feature = "ts", ts(export))]
654#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
655#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
656#[cfg_attr(feature = "serde", serde(tag = "type"))]
657#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
658#[repr(u32)]
659#[doc = "These flags encode the cellular network status"]
660pub enum CellularStatusFlag {
661 #[doc = "State unknown or not reportable."]
662 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
663 #[doc = "Modem is unusable"]
664 CELLULAR_STATUS_FLAG_FAILED = 1,
665 #[doc = "Modem is being initialized"]
666 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
667 #[doc = "Modem is locked"]
668 CELLULAR_STATUS_FLAG_LOCKED = 3,
669 #[doc = "Modem is not enabled and is powered down"]
670 CELLULAR_STATUS_FLAG_DISABLED = 4,
671 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
672 CELLULAR_STATUS_FLAG_DISABLING = 5,
673 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
674 CELLULAR_STATUS_FLAG_ENABLING = 6,
675 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
676 CELLULAR_STATUS_FLAG_ENABLED = 7,
677 #[doc = "Modem is searching for a network provider to register"]
678 CELLULAR_STATUS_FLAG_SEARCHING = 8,
679 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
680 CELLULAR_STATUS_FLAG_REGISTERED = 9,
681 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
682 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
683 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
684 CELLULAR_STATUS_FLAG_CONNECTING = 11,
685 #[doc = "One or more packet data bearers is active and connected"]
686 CELLULAR_STATUS_FLAG_CONNECTED = 12,
687}
688impl CellularStatusFlag {
689 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
690}
691impl Default for CellularStatusFlag {
692 fn default() -> Self {
693 Self::DEFAULT
694 }
695}
696#[cfg_attr(feature = "ts", derive(TS))]
697#[cfg_attr(feature = "ts", ts(export))]
698#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
699#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
700#[cfg_attr(feature = "serde", serde(tag = "type"))]
701#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
702#[repr(u32)]
703#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
704pub enum CompMetadataType {
705 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
706 COMP_METADATA_TYPE_GENERAL = 0,
707 #[doc = "Parameter meta data."]
708 COMP_METADATA_TYPE_PARAMETER = 1,
709 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
710 COMP_METADATA_TYPE_COMMANDS = 2,
711 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
712 COMP_METADATA_TYPE_PERIPHERALS = 3,
713 #[doc = "Meta data for the events interface."]
714 COMP_METADATA_TYPE_EVENTS = 4,
715 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
716 COMP_METADATA_TYPE_ACTUATORS = 5,
717}
718impl CompMetadataType {
719 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
720}
721impl Default for CompMetadataType {
722 fn default() -> Self {
723 Self::DEFAULT
724 }
725}
726#[cfg_attr(feature = "ts", derive(TS))]
727#[cfg_attr(feature = "ts", ts(export))]
728#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
729#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
730#[cfg_attr(feature = "serde", serde(tag = "type"))]
731#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
732#[repr(u32)]
733#[doc = "Indicates the ESC connection type."]
734pub enum EscConnectionType {
735 #[doc = "Traditional PPM ESC."]
736 ESC_CONNECTION_TYPE_PPM = 0,
737 #[doc = "Serial Bus connected ESC."]
738 ESC_CONNECTION_TYPE_SERIAL = 1,
739 #[doc = "One Shot PPM ESC."]
740 ESC_CONNECTION_TYPE_ONESHOT = 2,
741 #[doc = "I2C ESC."]
742 ESC_CONNECTION_TYPE_I2C = 3,
743 #[doc = "CAN-Bus ESC."]
744 ESC_CONNECTION_TYPE_CAN = 4,
745 #[doc = "DShot ESC."]
746 ESC_CONNECTION_TYPE_DSHOT = 5,
747}
748impl EscConnectionType {
749 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
750}
751impl Default for EscConnectionType {
752 fn default() -> Self {
753 Self::DEFAULT
754 }
755}
756bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
757impl EscFailureFlags {
758 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
759}
760impl Default for EscFailureFlags {
761 fn default() -> Self {
762 Self::DEFAULT
763 }
764}
765bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
766impl EstimatorStatusFlags {
767 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
768}
769impl Default for EstimatorStatusFlags {
770 fn default() -> Self {
771 Self::DEFAULT
772 }
773}
774#[cfg_attr(feature = "ts", derive(TS))]
775#[cfg_attr(feature = "ts", ts(export))]
776#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
777#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
778#[cfg_attr(feature = "serde", serde(tag = "type"))]
779#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
780#[repr(u32)]
781#[doc = "List of possible failure type to inject."]
782pub enum FailureType {
783 #[doc = "No failure injected, used to reset a previous failure."]
784 FAILURE_TYPE_OK = 0,
785 #[doc = "Sets unit off, so completely non-responsive."]
786 FAILURE_TYPE_OFF = 1,
787 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
788 FAILURE_TYPE_STUCK = 2,
789 #[doc = "Unit is reporting complete garbage."]
790 FAILURE_TYPE_GARBAGE = 3,
791 #[doc = "Unit is consistently wrong."]
792 FAILURE_TYPE_WRONG = 4,
793 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
794 FAILURE_TYPE_SLOW = 5,
795 #[doc = "Data of unit is delayed in time."]
796 FAILURE_TYPE_DELAYED = 6,
797 #[doc = "Unit is sometimes working, sometimes not."]
798 FAILURE_TYPE_INTERMITTENT = 7,
799}
800impl FailureType {
801 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
802}
803impl Default for FailureType {
804 fn default() -> Self {
805 Self::DEFAULT
806 }
807}
808#[cfg_attr(feature = "ts", derive(TS))]
809#[cfg_attr(feature = "ts", ts(export))]
810#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
811#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
812#[cfg_attr(feature = "serde", serde(tag = "type"))]
813#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
814#[repr(u32)]
815#[doc = "List of possible units where failures can be injected."]
816pub enum FailureUnit {
817 FAILURE_UNIT_SENSOR_GYRO = 0,
818 FAILURE_UNIT_SENSOR_ACCEL = 1,
819 FAILURE_UNIT_SENSOR_MAG = 2,
820 FAILURE_UNIT_SENSOR_BARO = 3,
821 FAILURE_UNIT_SENSOR_GPS = 4,
822 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
823 FAILURE_UNIT_SENSOR_VIO = 6,
824 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
825 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
826 FAILURE_UNIT_SYSTEM_BATTERY = 100,
827 FAILURE_UNIT_SYSTEM_MOTOR = 101,
828 FAILURE_UNIT_SYSTEM_SERVO = 102,
829 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
830 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
831 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
832}
833impl FailureUnit {
834 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
835}
836impl Default for FailureUnit {
837 fn default() -> Self {
838 Self::DEFAULT
839 }
840}
841#[cfg_attr(feature = "ts", derive(TS))]
842#[cfg_attr(feature = "ts", ts(export))]
843#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
844#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
845#[cfg_attr(feature = "serde", serde(tag = "type"))]
846#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
847#[repr(u32)]
848pub enum FenceBreach {
849 #[doc = "No last fence breach"]
850 FENCE_BREACH_NONE = 0,
851 #[doc = "Breached minimum altitude"]
852 FENCE_BREACH_MINALT = 1,
853 #[doc = "Breached maximum altitude"]
854 FENCE_BREACH_MAXALT = 2,
855 #[doc = "Breached fence boundary"]
856 FENCE_BREACH_BOUNDARY = 3,
857}
858impl FenceBreach {
859 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
860}
861impl Default for FenceBreach {
862 fn default() -> Self {
863 Self::DEFAULT
864 }
865}
866#[cfg_attr(feature = "ts", derive(TS))]
867#[cfg_attr(feature = "ts", ts(export))]
868#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
869#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
870#[cfg_attr(feature = "serde", serde(tag = "type"))]
871#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
872#[repr(u32)]
873#[doc = "Actions being taken to mitigate/prevent fence breach"]
874pub enum FenceMitigate {
875 #[doc = "Unknown"]
876 FENCE_MITIGATE_UNKNOWN = 0,
877 #[doc = "No actions being taken"]
878 FENCE_MITIGATE_NONE = 1,
879 #[doc = "Velocity limiting active to prevent breach"]
880 FENCE_MITIGATE_VEL_LIMIT = 2,
881}
882impl FenceMitigate {
883 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
884}
885impl Default for FenceMitigate {
886 fn default() -> Self {
887 Self::DEFAULT
888 }
889}
890#[cfg_attr(feature = "ts", derive(TS))]
891#[cfg_attr(feature = "ts", ts(export))]
892#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
893#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
894#[cfg_attr(feature = "serde", serde(tag = "type"))]
895#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
896#[repr(u32)]
897#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
898pub enum FenceType {
899 #[doc = "Maximum altitude fence"]
900 FENCE_TYPE_ALT_MAX = 1,
901 #[doc = "Circle fence"]
902 FENCE_TYPE_CIRCLE = 2,
903 #[doc = "Polygon fence"]
904 FENCE_TYPE_POLYGON = 4,
905 #[doc = "Minimum altitude fence"]
906 FENCE_TYPE_ALT_MIN = 8,
907}
908impl FenceType {
909 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
910}
911impl Default for FenceType {
912 fn default() -> Self {
913 Self::DEFAULT
914 }
915}
916#[cfg_attr(feature = "ts", derive(TS))]
917#[cfg_attr(feature = "ts", ts(export))]
918#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
920#[cfg_attr(feature = "serde", serde(tag = "type"))]
921#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
922#[repr(u32)]
923#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
924pub enum FirmwareVersionType {
925 #[doc = "development release"]
926 FIRMWARE_VERSION_TYPE_DEV = 0,
927 #[doc = "alpha release"]
928 FIRMWARE_VERSION_TYPE_ALPHA = 64,
929 #[doc = "beta release"]
930 FIRMWARE_VERSION_TYPE_BETA = 128,
931 #[doc = "release candidate"]
932 FIRMWARE_VERSION_TYPE_RC = 192,
933 #[doc = "official stable release"]
934 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
935}
936impl FirmwareVersionType {
937 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
938}
939impl Default for FirmwareVersionType {
940 fn default() -> Self {
941 Self::DEFAULT
942 }
943}
944bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
945impl GimbalDeviceCapFlags {
946 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
947}
948impl Default for GimbalDeviceCapFlags {
949 fn default() -> Self {
950 Self::DEFAULT
951 }
952}
953bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
954impl GimbalDeviceErrorFlags {
955 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
956}
957impl Default for GimbalDeviceErrorFlags {
958 fn default() -> Self {
959 Self::DEFAULT
960 }
961}
962bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
963impl GimbalDeviceFlags {
964 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
965}
966impl Default for GimbalDeviceFlags {
967 fn default() -> Self {
968 Self::DEFAULT
969 }
970}
971bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
972impl GimbalManagerCapFlags {
973 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
974}
975impl Default for GimbalManagerCapFlags {
976 fn default() -> Self {
977 Self::DEFAULT
978 }
979}
980bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
981impl GimbalManagerFlags {
982 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
983}
984impl Default for GimbalManagerFlags {
985 fn default() -> Self {
986 Self::DEFAULT
987 }
988}
989#[cfg_attr(feature = "ts", derive(TS))]
990#[cfg_attr(feature = "ts", ts(export))]
991#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
992#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
993#[cfg_attr(feature = "serde", serde(tag = "type"))]
994#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
995#[repr(u32)]
996#[doc = "Type of GPS fix"]
997pub enum GpsFixType {
998 #[doc = "No GPS connected"]
999 GPS_FIX_TYPE_NO_GPS = 0,
1000 #[doc = "No position information, GPS is connected"]
1001 GPS_FIX_TYPE_NO_FIX = 1,
1002 #[doc = "2D position"]
1003 GPS_FIX_TYPE_2D_FIX = 2,
1004 #[doc = "3D position"]
1005 GPS_FIX_TYPE_3D_FIX = 3,
1006 #[doc = "DGPS/SBAS aided 3D position"]
1007 GPS_FIX_TYPE_DGPS = 4,
1008 #[doc = "RTK float, 3D position"]
1009 GPS_FIX_TYPE_RTK_FLOAT = 5,
1010 #[doc = "RTK Fixed, 3D position"]
1011 GPS_FIX_TYPE_RTK_FIXED = 6,
1012 #[doc = "Static fixed, typically used for base stations"]
1013 GPS_FIX_TYPE_STATIC = 7,
1014 #[doc = "PPP, 3D position."]
1015 GPS_FIX_TYPE_PPP = 8,
1016}
1017impl GpsFixType {
1018 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
1019}
1020impl Default for GpsFixType {
1021 fn default() -> Self {
1022 Self::DEFAULT
1023 }
1024}
1025bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
1026impl GpsInputIgnoreFlags {
1027 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
1028}
1029impl Default for GpsInputIgnoreFlags {
1030 fn default() -> Self {
1031 Self::DEFAULT
1032 }
1033}
1034#[cfg_attr(feature = "ts", derive(TS))]
1035#[cfg_attr(feature = "ts", ts(export))]
1036#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1037#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1038#[cfg_attr(feature = "serde", serde(tag = "type"))]
1039#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1040#[repr(u32)]
1041#[doc = "Gripper actions."]
1042pub enum GripperActions {
1043 #[doc = "Gripper release cargo."]
1044 GRIPPER_ACTION_RELEASE = 0,
1045 #[doc = "Gripper grab onto cargo."]
1046 GRIPPER_ACTION_GRAB = 1,
1047}
1048impl GripperActions {
1049 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
1050}
1051impl Default for GripperActions {
1052 fn default() -> Self {
1053 Self::DEFAULT
1054 }
1055}
1056bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1057impl HighresImuUpdatedFlags {
1058 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1059}
1060impl Default for HighresImuUpdatedFlags {
1061 fn default() -> Self {
1062 Self::DEFAULT
1063 }
1064}
1065bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1066impl HilActuatorControlsFlags {
1067 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1068}
1069impl Default for HilActuatorControlsFlags {
1070 fn default() -> Self {
1071 Self::DEFAULT
1072 }
1073}
1074bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1075impl HilSensorUpdatedFlags {
1076 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1077}
1078impl Default for HilSensorUpdatedFlags {
1079 fn default() -> Self {
1080 Self::DEFAULT
1081 }
1082}
1083bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1084impl HlFailureFlag {
1085 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1086}
1087impl Default for HlFailureFlag {
1088 fn default() -> Self {
1089 Self::DEFAULT
1090 }
1091}
1092bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1093impl IlluminatorErrorFlags {
1094 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1095}
1096impl Default for IlluminatorErrorFlags {
1097 fn default() -> Self {
1098 Self::DEFAULT
1099 }
1100}
1101#[cfg_attr(feature = "ts", derive(TS))]
1102#[cfg_attr(feature = "ts", ts(export))]
1103#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1104#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1105#[cfg_attr(feature = "serde", serde(tag = "type"))]
1106#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1107#[repr(u32)]
1108#[doc = "Modes of illuminator"]
1109pub enum IlluminatorMode {
1110 #[doc = "Illuminator mode is not specified/unknown"]
1111 ILLUMINATOR_MODE_UNKNOWN = 0,
1112 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1113 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1114 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1115 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1116}
1117impl IlluminatorMode {
1118 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1119}
1120impl Default for IlluminatorMode {
1121 fn default() -> Self {
1122 Self::DEFAULT
1123 }
1124}
1125#[cfg_attr(feature = "ts", derive(TS))]
1126#[cfg_attr(feature = "ts", ts(export))]
1127#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1128#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1129#[cfg_attr(feature = "serde", serde(tag = "type"))]
1130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1131#[repr(u32)]
1132#[doc = "Type of landing target"]
1133pub enum LandingTargetType {
1134 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1135 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1136 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1137 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1138 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1139 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1140 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1141 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1142}
1143impl LandingTargetType {
1144 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1145}
1146impl Default for LandingTargetType {
1147 fn default() -> Self {
1148 Self::DEFAULT
1149 }
1150}
1151#[cfg_attr(feature = "ts", derive(TS))]
1152#[cfg_attr(feature = "ts", ts(export))]
1153#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1154#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1155#[cfg_attr(feature = "serde", serde(tag = "type"))]
1156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1157#[repr(u32)]
1158pub enum MagCalStatus {
1159 MAG_CAL_NOT_STARTED = 0,
1160 MAG_CAL_WAITING_TO_START = 1,
1161 MAG_CAL_RUNNING_STEP_ONE = 2,
1162 MAG_CAL_RUNNING_STEP_TWO = 3,
1163 MAG_CAL_SUCCESS = 4,
1164 MAG_CAL_FAILED = 5,
1165 MAG_CAL_BAD_ORIENTATION = 6,
1166 MAG_CAL_BAD_RADIUS = 7,
1167}
1168impl MagCalStatus {
1169 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1170}
1171impl Default for MagCalStatus {
1172 fn default() -> Self {
1173 Self::DEFAULT
1174 }
1175}
1176#[cfg_attr(feature = "ts", derive(TS))]
1177#[cfg_attr(feature = "ts", ts(export))]
1178#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1179#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1180#[cfg_attr(feature = "serde", serde(tag = "type"))]
1181#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1182#[repr(u32)]
1183pub enum MavArmAuthDeniedReason {
1184 #[doc = "Not a specific reason"]
1185 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1186 #[doc = "Authorizer will send the error as string to GCS"]
1187 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1188 #[doc = "At least one waypoint have a invalid value"]
1189 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1190 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1191 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1192 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1193 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1194 #[doc = "Weather is not good to fly"]
1195 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1196}
1197impl MavArmAuthDeniedReason {
1198 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1199}
1200impl Default for MavArmAuthDeniedReason {
1201 fn default() -> Self {
1202 Self::DEFAULT
1203 }
1204}
1205#[cfg_attr(feature = "ts", derive(TS))]
1206#[cfg_attr(feature = "ts", ts(export))]
1207#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1208#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1209#[cfg_attr(feature = "serde", serde(tag = "type"))]
1210#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1211#[repr(u32)]
1212#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1213pub enum MavAutopilot {
1214 #[doc = "Generic autopilot, full support for everything"]
1215 MAV_AUTOPILOT_GENERIC = 0,
1216 #[doc = "Reserved for future use."]
1217 MAV_AUTOPILOT_RESERVED = 1,
1218 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1219 MAV_AUTOPILOT_SLUGS = 2,
1220 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1221 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1222 #[doc = "OpenPilot, <http://openpilot.org>"]
1223 MAV_AUTOPILOT_OPENPILOT = 4,
1224 #[doc = "Generic autopilot only supporting simple waypoints"]
1225 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1226 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1227 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1228 #[doc = "Generic autopilot supporting the full mission command set"]
1229 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1230 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1231 MAV_AUTOPILOT_INVALID = 8,
1232 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1233 MAV_AUTOPILOT_PPZ = 9,
1234 #[doc = "UAV Dev Board"]
1235 MAV_AUTOPILOT_UDB = 10,
1236 #[doc = "FlexiPilot"]
1237 MAV_AUTOPILOT_FP = 11,
1238 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1239 MAV_AUTOPILOT_PX4 = 12,
1240 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1241 MAV_AUTOPILOT_SMACCMPILOT = 13,
1242 #[doc = "AutoQuad -- <http://autoquad.org>"]
1243 MAV_AUTOPILOT_AUTOQUAD = 14,
1244 #[doc = "Armazila -- <http://armazila.com>"]
1245 MAV_AUTOPILOT_ARMAZILA = 15,
1246 #[doc = "Aerob -- <http://aerob.ru>"]
1247 MAV_AUTOPILOT_AEROB = 16,
1248 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1249 MAV_AUTOPILOT_ASLUAV = 17,
1250 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1251 MAV_AUTOPILOT_SMARTAP = 18,
1252 #[doc = "AirRails - <http://uaventure.com>"]
1253 MAV_AUTOPILOT_AIRRAILS = 19,
1254 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1255 MAV_AUTOPILOT_REFLEX = 20,
1256}
1257impl MavAutopilot {
1258 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1259}
1260impl Default for MavAutopilot {
1261 fn default() -> Self {
1262 Self::DEFAULT
1263 }
1264}
1265#[cfg_attr(feature = "ts", derive(TS))]
1266#[cfg_attr(feature = "ts", ts(export))]
1267#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1268#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1269#[cfg_attr(feature = "serde", serde(tag = "type"))]
1270#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1271#[repr(u32)]
1272#[doc = "Enumeration for battery charge states."]
1273pub enum MavBatteryChargeState {
1274 #[doc = "Low battery state is not provided"]
1275 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1276 #[doc = "Battery is not in low state. Normal operation."]
1277 MAV_BATTERY_CHARGE_STATE_OK = 1,
1278 #[doc = "Battery state is low, warn and monitor close."]
1279 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1280 #[doc = "Battery state is critical, return or abort immediately."]
1281 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1282 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1283 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1284 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1285 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1286 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1287 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1288 #[doc = "Battery is charging."]
1289 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1290}
1291impl MavBatteryChargeState {
1292 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1293}
1294impl Default for MavBatteryChargeState {
1295 fn default() -> Self {
1296 Self::DEFAULT
1297 }
1298}
1299bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1300impl MavBatteryFault {
1301 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1302}
1303impl Default for MavBatteryFault {
1304 fn default() -> Self {
1305 Self::DEFAULT
1306 }
1307}
1308#[cfg_attr(feature = "ts", derive(TS))]
1309#[cfg_attr(feature = "ts", ts(export))]
1310#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1312#[cfg_attr(feature = "serde", serde(tag = "type"))]
1313#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1314#[repr(u32)]
1315#[doc = "Enumeration of battery functions"]
1316pub enum MavBatteryFunction {
1317 #[doc = "Battery function is unknown"]
1318 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1319 #[doc = "Battery supports all flight systems"]
1320 MAV_BATTERY_FUNCTION_ALL = 1,
1321 #[doc = "Battery for the propulsion system"]
1322 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1323 #[doc = "Avionics battery"]
1324 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1325 #[doc = "Payload battery"]
1326 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1327}
1328impl MavBatteryFunction {
1329 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1330}
1331impl Default for MavBatteryFunction {
1332 fn default() -> Self {
1333 Self::DEFAULT
1334 }
1335}
1336#[cfg_attr(feature = "ts", derive(TS))]
1337#[cfg_attr(feature = "ts", ts(export))]
1338#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1339#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1340#[cfg_attr(feature = "serde", serde(tag = "type"))]
1341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1342#[repr(u32)]
1343#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1344pub enum MavBatteryMode {
1345 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1346 MAV_BATTERY_MODE_UNKNOWN = 0,
1347 #[doc = "Battery is auto discharging (towards storage level)."]
1348 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1349 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1350 MAV_BATTERY_MODE_HOT_SWAP = 2,
1351}
1352impl MavBatteryMode {
1353 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1354}
1355impl Default for MavBatteryMode {
1356 fn default() -> Self {
1357 Self::DEFAULT
1358 }
1359}
1360#[cfg_attr(feature = "ts", derive(TS))]
1361#[cfg_attr(feature = "ts", ts(export))]
1362#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1363#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1364#[cfg_attr(feature = "serde", serde(tag = "type"))]
1365#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1366#[repr(u32)]
1367#[doc = "Enumeration of battery types"]
1368pub enum MavBatteryType {
1369 #[doc = "Not specified."]
1370 MAV_BATTERY_TYPE_UNKNOWN = 0,
1371 #[doc = "Lithium polymer battery"]
1372 MAV_BATTERY_TYPE_LIPO = 1,
1373 #[doc = "Lithium-iron-phosphate battery"]
1374 MAV_BATTERY_TYPE_LIFE = 2,
1375 #[doc = "Lithium-ION battery"]
1376 MAV_BATTERY_TYPE_LION = 3,
1377 #[doc = "Nickel metal hydride battery"]
1378 MAV_BATTERY_TYPE_NIMH = 4,
1379}
1380impl MavBatteryType {
1381 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1382}
1383impl Default for MavBatteryType {
1384 fn default() -> Self {
1385 Self::DEFAULT
1386 }
1387}
1388#[cfg_attr(feature = "ts", derive(TS))]
1389#[cfg_attr(feature = "ts", ts(export))]
1390#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1391#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1392#[cfg_attr(feature = "serde", serde(tag = "type"))]
1393#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1394#[repr(u32)]
1395#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1396pub enum MavCmd {
1397 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1398 MAV_CMD_NAV_WAYPOINT = 16,
1399 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1400 MAV_CMD_NAV_LOITER_UNLIM = 17,
1401 #[doc = "Loiter around this waypoint for X turns"]
1402 MAV_CMD_NAV_LOITER_TURNS = 18,
1403 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1404 MAV_CMD_NAV_LOITER_TIME = 19,
1405 #[doc = "Return to launch location"]
1406 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1407 #[doc = "Land at location."]
1408 MAV_CMD_NAV_LAND = 21,
1409 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1410 MAV_CMD_NAV_TAKEOFF = 22,
1411 #[doc = "Land at local position (local frame only)"]
1412 MAV_CMD_NAV_LAND_LOCAL = 23,
1413 #[doc = "Takeoff from local position (local frame only)"]
1414 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1415 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1416 MAV_CMD_NAV_FOLLOW = 25,
1417 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1418 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1419 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1420 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1421 #[doc = "Begin following a target"]
1422 MAV_CMD_DO_FOLLOW = 32,
1423 #[doc = "Reposition the MAV after a follow target command has been sent"]
1424 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1425 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1426 MAV_CMD_DO_ORBIT = 34,
1427 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1428 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1429 MAV_CMD_NAV_ROI = 80,
1430 #[doc = "Control autonomous path planning on the MAV."]
1431 MAV_CMD_NAV_PATHPLANNING = 81,
1432 #[doc = "Navigate to waypoint using a spline path."]
1433 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1434 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1435 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1436 #[doc = "Land using VTOL mode"]
1437 MAV_CMD_NAV_VTOL_LAND = 85,
1438 #[doc = "hand control over to an external controller"]
1439 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1440 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1441 MAV_CMD_NAV_DELAY = 93,
1442 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1443 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1444 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1445 MAV_CMD_NAV_LAST = 95,
1446 #[doc = "Delay mission state machine."]
1447 MAV_CMD_CONDITION_DELAY = 112,
1448 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1449 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1450 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1451 MAV_CMD_CONDITION_DISTANCE = 114,
1452 #[doc = "Reach a certain target angle."]
1453 MAV_CMD_CONDITION_YAW = 115,
1454 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1455 MAV_CMD_CONDITION_LAST = 159,
1456 #[doc = "Set system mode."]
1457 MAV_CMD_DO_SET_MODE = 176,
1458 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1459 MAV_CMD_DO_JUMP = 177,
1460 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1461 MAV_CMD_DO_CHANGE_SPEED = 178,
1462 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1463 MAV_CMD_DO_SET_HOME = 179,
1464 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1465 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1466 MAV_CMD_DO_SET_PARAMETER = 180,
1467 #[doc = "Set a relay to a condition."]
1468 MAV_CMD_DO_SET_RELAY = 181,
1469 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1470 MAV_CMD_DO_REPEAT_RELAY = 182,
1471 #[doc = "Set a servo to a desired PWM value."]
1472 MAV_CMD_DO_SET_SERVO = 183,
1473 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1474 MAV_CMD_DO_REPEAT_SERVO = 184,
1475 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1476 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1477 #[doc = "Change altitude set point."]
1478 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1479 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1480 MAV_CMD_DO_SET_ACTUATOR = 187,
1481 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1482 MAV_CMD_DO_RETURN_PATH_START = 188,
1483 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1484 MAV_CMD_DO_LAND_START = 189,
1485 #[doc = "Mission command to perform a landing from a rally point."]
1486 MAV_CMD_DO_RALLY_LAND = 190,
1487 #[doc = "Mission command to safely abort an autonomous landing."]
1488 MAV_CMD_DO_GO_AROUND = 191,
1489 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1490 MAV_CMD_DO_REPOSITION = 192,
1491 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1492 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1493 #[doc = "Set moving direction to forward or reverse."]
1494 MAV_CMD_DO_SET_REVERSE = 194,
1495 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1496 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1497 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1498 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1499 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1500 MAV_CMD_DO_SET_ROI_NONE = 197,
1501 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1502 MAV_CMD_DO_SET_ROI_SYSID = 198,
1503 #[doc = "Control onboard camera system."]
1504 MAV_CMD_DO_CONTROL_VIDEO = 200,
1505 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1506 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1507 MAV_CMD_DO_SET_ROI = 201,
1508 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1509 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1510 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1511 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1512 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1513 #[doc = "Mission command to configure a camera or antenna mount"]
1514 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1515 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1516 #[doc = "Mission command to control a camera or antenna mount"]
1517 MAV_CMD_DO_MOUNT_CONTROL = 205,
1518 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1519 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1520 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1521 MAV_CMD_DO_FENCE_ENABLE = 207,
1522 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1523 MAV_CMD_DO_PARACHUTE = 208,
1524 #[doc = "Command to perform motor test."]
1525 MAV_CMD_DO_MOTOR_TEST = 209,
1526 #[doc = "Change to/from inverted flight."]
1527 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1528 #[doc = "Mission command to operate a gripper."]
1529 MAV_CMD_DO_GRIPPER = 211,
1530 #[doc = "Enable/disable autotune."]
1531 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1532 #[doc = "Sets a desired vehicle turn angle and speed change."]
1533 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1534 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1535 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1536 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1537 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1538 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1539 #[doc = "set id of master controller"]
1540 MAV_CMD_DO_GUIDED_MASTER = 221,
1541 #[doc = "Set limits for external control"]
1542 MAV_CMD_DO_GUIDED_LIMITS = 222,
1543 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1544 MAV_CMD_DO_ENGINE_CONTROL = 223,
1545 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1546 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1547 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1548 MAV_CMD_DO_LAST = 240,
1549 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1550 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1551 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1552 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1553 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1554 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1555 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1556 MAV_CMD_PREFLIGHT_STORAGE = 245,
1557 #[doc = "Request the reboot or shutdown of system components."]
1558 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1559 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1560 MAV_CMD_OVERRIDE_GOTO = 252,
1561 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1562 MAV_CMD_OBLIQUE_SURVEY = 260,
1563 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1564 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1565 #[doc = "start running a mission"]
1566 MAV_CMD_MISSION_START = 300,
1567 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1568 MAV_CMD_ACTUATOR_TEST = 310,
1569 #[doc = "Actuator configuration command."]
1570 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1571 #[doc = "Arms / Disarms a component"]
1572 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1573 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1574 MAV_CMD_RUN_PREARM_CHECKS = 401,
1575 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1576 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1577 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1578 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1579 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1580 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1581 MAV_CMD_GET_HOME_POSITION = 410,
1582 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1583 MAV_CMD_INJECT_FAILURE = 420,
1584 #[doc = "Starts receiver pairing."]
1585 MAV_CMD_START_RX_PAIR = 500,
1586 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1587 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1588 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1589 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1590 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1591 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1592 MAV_CMD_REQUEST_MESSAGE = 512,
1593 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1594 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1595 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1596 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1597 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1598 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1599 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1600 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1601 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1602 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1603 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1604 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1605 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1606 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1607 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1608 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1609 MAV_CMD_STORAGE_FORMAT = 526,
1610 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1611 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1612 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1613 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1614 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1615 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1616 #[doc = "Reset all camera settings to Factory Default"]
1617 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1618 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1619 MAV_CMD_SET_CAMERA_MODE = 530,
1620 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1621 MAV_CMD_SET_CAMERA_ZOOM = 531,
1622 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1623 MAV_CMD_SET_CAMERA_FOCUS = 532,
1624 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1625 MAV_CMD_SET_STORAGE_USAGE = 533,
1626 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1627 MAV_CMD_SET_CAMERA_SOURCE = 534,
1628 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1629 MAV_CMD_JUMP_TAG = 600,
1630 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1631 MAV_CMD_DO_JUMP_TAG = 601,
1632 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1633 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1634 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1635 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1636 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1637 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1638 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1639 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1640 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1641 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1642 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1643 #[doc = "Enable or disable on-board camera triggering system."]
1644 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1645 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1646 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1647 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1648 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1649 #[doc = "Stops ongoing tracking."]
1650 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1651 #[doc = "Starts video capture (recording)."]
1652 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1653 #[doc = "Stop the current video capture (recording)."]
1654 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1655 #[doc = "Start video streaming"]
1656 MAV_CMD_VIDEO_START_STREAMING = 2502,
1657 #[doc = "Stop the given video stream"]
1658 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1659 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1660 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1661 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1662 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1663 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1664 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1665 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1666 MAV_CMD_LOGGING_START = 2510,
1667 #[doc = "Request to stop streaming log data over MAVLink"]
1668 MAV_CMD_LOGGING_STOP = 2511,
1669 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1670 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1671 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1672 #[doc = "Create a panorama at the current position"]
1673 MAV_CMD_PANORAMA_CREATE = 2800,
1674 #[doc = "Request VTOL transition"]
1675 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1676 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1677 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1678 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1679 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1680 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1681 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1682 #[doc = "Delay mission state machine until gate has been reached."]
1683 MAV_CMD_CONDITION_GATE = 4501,
1684 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1685 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1686 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1687 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1688 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1689 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1690 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1691 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1692 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1693 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1694 #[doc = "Rally point. You can have multiple rally points defined."]
1695 MAV_CMD_NAV_RALLY_POINT = 5100,
1696 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1697 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1698 #[doc = "Change state of safety switch."]
1699 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1700 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1701 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1702 #[deprecated = " (Deprecated since 2021-06)"]
1703 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1704 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1705 #[deprecated = " (Deprecated since 2021-06)"]
1706 #[doc = "Control the payload deployment."]
1707 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1708 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1709 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1710 #[doc = "Command to operate winch."]
1711 MAV_CMD_DO_WINCH = 42600,
1712 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1713 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1714 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1715 MAV_CMD_WAYPOINT_USER_1 = 31000,
1716 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1717 MAV_CMD_WAYPOINT_USER_2 = 31001,
1718 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1719 MAV_CMD_WAYPOINT_USER_3 = 31002,
1720 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1721 MAV_CMD_WAYPOINT_USER_4 = 31003,
1722 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1723 MAV_CMD_WAYPOINT_USER_5 = 31004,
1724 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1725 MAV_CMD_SPATIAL_USER_1 = 31005,
1726 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1727 MAV_CMD_SPATIAL_USER_2 = 31006,
1728 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1729 MAV_CMD_SPATIAL_USER_3 = 31007,
1730 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1731 MAV_CMD_SPATIAL_USER_4 = 31008,
1732 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1733 MAV_CMD_SPATIAL_USER_5 = 31009,
1734 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1735 MAV_CMD_USER_1 = 31010,
1736 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1737 MAV_CMD_USER_2 = 31011,
1738 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1739 MAV_CMD_USER_3 = 31012,
1740 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1741 MAV_CMD_USER_4 = 31013,
1742 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1743 MAV_CMD_USER_5 = 31014,
1744 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1745 MAV_CMD_CAN_FORWARD = 32000,
1746 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1747 MAV_CMD_PREFLIGHT_STORAGE_ADVANCED = 0,
1748}
1749impl MavCmd {
1750 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1751}
1752impl Default for MavCmd {
1753 fn default() -> Self {
1754 Self::DEFAULT
1755 }
1756}
1757#[cfg_attr(feature = "ts", derive(TS))]
1758#[cfg_attr(feature = "ts", ts(export))]
1759#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1760#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1761#[cfg_attr(feature = "serde", serde(tag = "type"))]
1762#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1763#[repr(u32)]
1764#[doc = "Possible actions an aircraft can take to avoid a collision."]
1765pub enum MavCollisionAction {
1766 #[doc = "Ignore any potential collisions"]
1767 MAV_COLLISION_ACTION_NONE = 0,
1768 #[doc = "Report potential collision"]
1769 MAV_COLLISION_ACTION_REPORT = 1,
1770 #[doc = "Ascend or Descend to avoid threat"]
1771 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1772 #[doc = "Move horizontally to avoid threat"]
1773 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1774 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1775 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1776 #[doc = "Aircraft to fly directly back to its launch point"]
1777 MAV_COLLISION_ACTION_RTL = 5,
1778 #[doc = "Aircraft to stop in place"]
1779 MAV_COLLISION_ACTION_HOVER = 6,
1780}
1781impl MavCollisionAction {
1782 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1783}
1784impl Default for MavCollisionAction {
1785 fn default() -> Self {
1786 Self::DEFAULT
1787 }
1788}
1789#[cfg_attr(feature = "ts", derive(TS))]
1790#[cfg_attr(feature = "ts", ts(export))]
1791#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1792#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1793#[cfg_attr(feature = "serde", serde(tag = "type"))]
1794#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1795#[repr(u32)]
1796#[doc = "Source of information about this collision."]
1797pub enum MavCollisionSrc {
1798 #[doc = "ID field references ADSB_VEHICLE packets"]
1799 MAV_COLLISION_SRC_ADSB = 0,
1800 #[doc = "ID field references MAVLink SRC ID"]
1801 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1802}
1803impl MavCollisionSrc {
1804 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1805}
1806impl Default for MavCollisionSrc {
1807 fn default() -> Self {
1808 Self::DEFAULT
1809 }
1810}
1811#[cfg_attr(feature = "ts", derive(TS))]
1812#[cfg_attr(feature = "ts", ts(export))]
1813#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1814#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1815#[cfg_attr(feature = "serde", serde(tag = "type"))]
1816#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1817#[repr(u32)]
1818#[doc = "Aircraft-rated danger from this threat."]
1819pub enum MavCollisionThreatLevel {
1820 #[doc = "Not a threat"]
1821 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1822 #[doc = "Craft is mildly concerned about this threat"]
1823 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1824 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1825 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1826}
1827impl MavCollisionThreatLevel {
1828 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1829}
1830impl Default for MavCollisionThreatLevel {
1831 fn default() -> Self {
1832 Self::DEFAULT
1833 }
1834}
1835#[cfg_attr(feature = "ts", derive(TS))]
1836#[cfg_attr(feature = "ts", ts(export))]
1837#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1838#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1839#[cfg_attr(feature = "serde", serde(tag = "type"))]
1840#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1841#[repr(u32)]
1842#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1843pub enum MavComponent {
1844 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1845 MAV_COMP_ID_ALL = 0,
1846 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1847 MAV_COMP_ID_AUTOPILOT1 = 1,
1848 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1849 MAV_COMP_ID_USER1 = 25,
1850 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1851 MAV_COMP_ID_USER2 = 26,
1852 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1853 MAV_COMP_ID_USER3 = 27,
1854 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1855 MAV_COMP_ID_USER4 = 28,
1856 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1857 MAV_COMP_ID_USER5 = 29,
1858 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1859 MAV_COMP_ID_USER6 = 30,
1860 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1861 MAV_COMP_ID_USER7 = 31,
1862 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1863 MAV_COMP_ID_USER8 = 32,
1864 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1865 MAV_COMP_ID_USER9 = 33,
1866 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1867 MAV_COMP_ID_USER10 = 34,
1868 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1869 MAV_COMP_ID_USER11 = 35,
1870 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1871 MAV_COMP_ID_USER12 = 36,
1872 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1873 MAV_COMP_ID_USER13 = 37,
1874 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1875 MAV_COMP_ID_USER14 = 38,
1876 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1877 MAV_COMP_ID_USER15 = 39,
1878 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1879 MAV_COMP_ID_USER16 = 40,
1880 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1881 MAV_COMP_ID_USER17 = 41,
1882 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1883 MAV_COMP_ID_USER18 = 42,
1884 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1885 MAV_COMP_ID_USER19 = 43,
1886 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1887 MAV_COMP_ID_USER20 = 44,
1888 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1889 MAV_COMP_ID_USER21 = 45,
1890 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1891 MAV_COMP_ID_USER22 = 46,
1892 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1893 MAV_COMP_ID_USER23 = 47,
1894 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1895 MAV_COMP_ID_USER24 = 48,
1896 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1897 MAV_COMP_ID_USER25 = 49,
1898 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1899 MAV_COMP_ID_USER26 = 50,
1900 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1901 MAV_COMP_ID_USER27 = 51,
1902 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1903 MAV_COMP_ID_USER28 = 52,
1904 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1905 MAV_COMP_ID_USER29 = 53,
1906 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1907 MAV_COMP_ID_USER30 = 54,
1908 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1909 MAV_COMP_ID_USER31 = 55,
1910 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1911 MAV_COMP_ID_USER32 = 56,
1912 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1913 MAV_COMP_ID_USER33 = 57,
1914 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1915 MAV_COMP_ID_USER34 = 58,
1916 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1917 MAV_COMP_ID_USER35 = 59,
1918 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1919 MAV_COMP_ID_USER36 = 60,
1920 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1921 MAV_COMP_ID_USER37 = 61,
1922 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1923 MAV_COMP_ID_USER38 = 62,
1924 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1925 MAV_COMP_ID_USER39 = 63,
1926 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1927 MAV_COMP_ID_USER40 = 64,
1928 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1929 MAV_COMP_ID_USER41 = 65,
1930 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1931 MAV_COMP_ID_USER42 = 66,
1932 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1933 MAV_COMP_ID_USER43 = 67,
1934 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1935 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1936 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1937 MAV_COMP_ID_USER45 = 69,
1938 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1939 MAV_COMP_ID_USER46 = 70,
1940 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1941 MAV_COMP_ID_USER47 = 71,
1942 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1943 MAV_COMP_ID_USER48 = 72,
1944 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1945 MAV_COMP_ID_USER49 = 73,
1946 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1947 MAV_COMP_ID_USER50 = 74,
1948 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1949 MAV_COMP_ID_USER51 = 75,
1950 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1951 MAV_COMP_ID_USER52 = 76,
1952 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1953 MAV_COMP_ID_USER53 = 77,
1954 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1955 MAV_COMP_ID_USER54 = 78,
1956 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1957 MAV_COMP_ID_USER55 = 79,
1958 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1959 MAV_COMP_ID_USER56 = 80,
1960 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1961 MAV_COMP_ID_USER57 = 81,
1962 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1963 MAV_COMP_ID_USER58 = 82,
1964 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1965 MAV_COMP_ID_USER59 = 83,
1966 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1967 MAV_COMP_ID_USER60 = 84,
1968 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1969 MAV_COMP_ID_USER61 = 85,
1970 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1971 MAV_COMP_ID_USER62 = 86,
1972 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1973 MAV_COMP_ID_USER63 = 87,
1974 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1975 MAV_COMP_ID_USER64 = 88,
1976 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1977 MAV_COMP_ID_USER65 = 89,
1978 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1979 MAV_COMP_ID_USER66 = 90,
1980 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1981 MAV_COMP_ID_USER67 = 91,
1982 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1983 MAV_COMP_ID_USER68 = 92,
1984 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1985 MAV_COMP_ID_USER69 = 93,
1986 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1987 MAV_COMP_ID_USER70 = 94,
1988 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1989 MAV_COMP_ID_USER71 = 95,
1990 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1991 MAV_COMP_ID_USER72 = 96,
1992 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1993 MAV_COMP_ID_USER73 = 97,
1994 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1995 MAV_COMP_ID_USER74 = 98,
1996 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1997 MAV_COMP_ID_USER75 = 99,
1998 #[doc = "Camera #1."]
1999 MAV_COMP_ID_CAMERA = 100,
2000 #[doc = "Camera #2."]
2001 MAV_COMP_ID_CAMERA2 = 101,
2002 #[doc = "Camera #3."]
2003 MAV_COMP_ID_CAMERA3 = 102,
2004 #[doc = "Camera #4."]
2005 MAV_COMP_ID_CAMERA4 = 103,
2006 #[doc = "Camera #5."]
2007 MAV_COMP_ID_CAMERA5 = 104,
2008 #[doc = "Camera #6."]
2009 MAV_COMP_ID_CAMERA6 = 105,
2010 #[doc = "Servo #1."]
2011 MAV_COMP_ID_SERVO1 = 140,
2012 #[doc = "Servo #2."]
2013 MAV_COMP_ID_SERVO2 = 141,
2014 #[doc = "Servo #3."]
2015 MAV_COMP_ID_SERVO3 = 142,
2016 #[doc = "Servo #4."]
2017 MAV_COMP_ID_SERVO4 = 143,
2018 #[doc = "Servo #5."]
2019 MAV_COMP_ID_SERVO5 = 144,
2020 #[doc = "Servo #6."]
2021 MAV_COMP_ID_SERVO6 = 145,
2022 #[doc = "Servo #7."]
2023 MAV_COMP_ID_SERVO7 = 146,
2024 #[doc = "Servo #8."]
2025 MAV_COMP_ID_SERVO8 = 147,
2026 #[doc = "Servo #9."]
2027 MAV_COMP_ID_SERVO9 = 148,
2028 #[doc = "Servo #10."]
2029 MAV_COMP_ID_SERVO10 = 149,
2030 #[doc = "Servo #11."]
2031 MAV_COMP_ID_SERVO11 = 150,
2032 #[doc = "Servo #12."]
2033 MAV_COMP_ID_SERVO12 = 151,
2034 #[doc = "Servo #13."]
2035 MAV_COMP_ID_SERVO13 = 152,
2036 #[doc = "Servo #14."]
2037 MAV_COMP_ID_SERVO14 = 153,
2038 #[doc = "Gimbal #1."]
2039 MAV_COMP_ID_GIMBAL = 154,
2040 #[doc = "Logging component."]
2041 MAV_COMP_ID_LOG = 155,
2042 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
2043 MAV_COMP_ID_ADSB = 156,
2044 #[doc = "On Screen Display (OSD) devices for video links."]
2045 MAV_COMP_ID_OSD = 157,
2046 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
2047 MAV_COMP_ID_PERIPHERAL = 158,
2048 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
2049 #[doc = "Gimbal ID for QX1."]
2050 MAV_COMP_ID_QX1_GIMBAL = 159,
2051 #[doc = "FLARM collision alert component."]
2052 MAV_COMP_ID_FLARM = 160,
2053 #[doc = "Parachute component."]
2054 MAV_COMP_ID_PARACHUTE = 161,
2055 #[doc = "Winch component."]
2056 MAV_COMP_ID_WINCH = 169,
2057 #[doc = "Gimbal #2."]
2058 MAV_COMP_ID_GIMBAL2 = 171,
2059 #[doc = "Gimbal #3."]
2060 MAV_COMP_ID_GIMBAL3 = 172,
2061 #[doc = "Gimbal #4"]
2062 MAV_COMP_ID_GIMBAL4 = 173,
2063 #[doc = "Gimbal #5."]
2064 MAV_COMP_ID_GIMBAL5 = 174,
2065 #[doc = "Gimbal #6."]
2066 MAV_COMP_ID_GIMBAL6 = 175,
2067 #[doc = "Battery #1."]
2068 MAV_COMP_ID_BATTERY = 180,
2069 #[doc = "Battery #2."]
2070 MAV_COMP_ID_BATTERY2 = 181,
2071 #[doc = "CAN over MAVLink client."]
2072 MAV_COMP_ID_MAVCAN = 189,
2073 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
2074 MAV_COMP_ID_MISSIONPLANNER = 190,
2075 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2076 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
2077 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2078 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
2079 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2080 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
2081 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2082 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
2083 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
2084 MAV_COMP_ID_PATHPLANNER = 195,
2085 #[doc = "Component that plans a collision free path between two points."]
2086 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2087 #[doc = "Component that provides position estimates using VIO techniques."]
2088 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2089 #[doc = "Component that manages pairing of vehicle and GCS."]
2090 MAV_COMP_ID_PAIRING_MANAGER = 198,
2091 #[doc = "Inertial Measurement Unit (IMU) #1."]
2092 MAV_COMP_ID_IMU = 200,
2093 #[doc = "Inertial Measurement Unit (IMU) #2."]
2094 MAV_COMP_ID_IMU_2 = 201,
2095 #[doc = "Inertial Measurement Unit (IMU) #3."]
2096 MAV_COMP_ID_IMU_3 = 202,
2097 #[doc = "GPS #1."]
2098 MAV_COMP_ID_GPS = 220,
2099 #[doc = "GPS #2."]
2100 MAV_COMP_ID_GPS2 = 221,
2101 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2102 MAV_COMP_ID_ODID_TXRX_1 = 236,
2103 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2104 MAV_COMP_ID_ODID_TXRX_2 = 237,
2105 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2106 MAV_COMP_ID_ODID_TXRX_3 = 238,
2107 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2108 MAV_COMP_ID_UDP_BRIDGE = 240,
2109 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2110 MAV_COMP_ID_UART_BRIDGE = 241,
2111 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2112 MAV_COMP_ID_TUNNEL_NODE = 242,
2113 #[doc = "Illuminator"]
2114 MAV_COMP_ID_ILLUMINATOR = 243,
2115 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2116 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2117 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2118}
2119impl MavComponent {
2120 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2121}
2122impl Default for MavComponent {
2123 fn default() -> Self {
2124 Self::DEFAULT
2125 }
2126}
2127#[cfg_attr(feature = "ts", derive(TS))]
2128#[cfg_attr(feature = "ts", ts(export))]
2129#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2131#[cfg_attr(feature = "serde", serde(tag = "type"))]
2132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2133#[repr(u32)]
2134#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2135#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2136pub enum MavDataStream {
2137 #[doc = "Enable all data streams"]
2138 MAV_DATA_STREAM_ALL = 0,
2139 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2140 MAV_DATA_STREAM_RAW_SENSORS = 1,
2141 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2142 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2143 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2144 MAV_DATA_STREAM_RC_CHANNELS = 3,
2145 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2146 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2147 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2148 MAV_DATA_STREAM_POSITION = 6,
2149 #[doc = "Dependent on the autopilot"]
2150 MAV_DATA_STREAM_EXTRA1 = 10,
2151 #[doc = "Dependent on the autopilot"]
2152 MAV_DATA_STREAM_EXTRA2 = 11,
2153 #[doc = "Dependent on the autopilot"]
2154 MAV_DATA_STREAM_EXTRA3 = 12,
2155}
2156impl MavDataStream {
2157 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2158}
2159impl Default for MavDataStream {
2160 fn default() -> Self {
2161 Self::DEFAULT
2162 }
2163}
2164#[cfg_attr(feature = "ts", derive(TS))]
2165#[cfg_attr(feature = "ts", ts(export))]
2166#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2167#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2168#[cfg_attr(feature = "serde", serde(tag = "type"))]
2169#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2170#[repr(u32)]
2171#[doc = "Enumeration of distance sensor types"]
2172pub enum MavDistanceSensor {
2173 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2174 MAV_DISTANCE_SENSOR_LASER = 0,
2175 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2176 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2177 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2178 MAV_DISTANCE_SENSOR_INFRARED = 2,
2179 #[doc = "Radar type, e.g. uLanding units"]
2180 MAV_DISTANCE_SENSOR_RADAR = 3,
2181 #[doc = "Broken or unknown type, e.g. analog units"]
2182 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2183}
2184impl MavDistanceSensor {
2185 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2186}
2187impl Default for MavDistanceSensor {
2188 fn default() -> Self {
2189 Self::DEFAULT
2190 }
2191}
2192#[cfg_attr(feature = "ts", derive(TS))]
2193#[cfg_attr(feature = "ts", ts(export))]
2194#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2195#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2196#[cfg_attr(feature = "serde", serde(tag = "type"))]
2197#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2198#[repr(u32)]
2199#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2200pub enum MavDoRepositionFlags {
2201 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2202 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2203}
2204impl MavDoRepositionFlags {
2205 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2206}
2207impl Default for MavDoRepositionFlags {
2208 fn default() -> Self {
2209 Self::DEFAULT
2210 }
2211}
2212#[cfg_attr(feature = "ts", derive(TS))]
2213#[cfg_attr(feature = "ts", ts(export))]
2214#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2216#[cfg_attr(feature = "serde", serde(tag = "type"))]
2217#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2218#[repr(u32)]
2219#[doc = "Enumeration of estimator types"]
2220pub enum MavEstimatorType {
2221 #[doc = "Unknown type of the estimator."]
2222 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2223 #[doc = "This is a naive estimator without any real covariance feedback."]
2224 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2225 #[doc = "Computer vision based estimate. Might be up to scale."]
2226 MAV_ESTIMATOR_TYPE_VISION = 2,
2227 #[doc = "Visual-inertial estimate."]
2228 MAV_ESTIMATOR_TYPE_VIO = 3,
2229 #[doc = "Plain GPS estimate."]
2230 MAV_ESTIMATOR_TYPE_GPS = 4,
2231 #[doc = "Estimator integrating GPS and inertial sensing."]
2232 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2233 #[doc = "Estimate from external motion capturing system."]
2234 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2235 #[doc = "Estimator based on lidar sensor input."]
2236 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2237 #[doc = "Estimator on autopilot."]
2238 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2239}
2240impl MavEstimatorType {
2241 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2242}
2243impl Default for MavEstimatorType {
2244 fn default() -> Self {
2245 Self::DEFAULT
2246 }
2247}
2248#[cfg_attr(feature = "ts", derive(TS))]
2249#[cfg_attr(feature = "ts", ts(export))]
2250#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2251#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2252#[cfg_attr(feature = "serde", serde(tag = "type"))]
2253#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2254#[repr(u32)]
2255#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2256pub enum MavEventCurrentSequenceFlags {
2257 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2258 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2259}
2260impl MavEventCurrentSequenceFlags {
2261 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2262}
2263impl Default for MavEventCurrentSequenceFlags {
2264 fn default() -> Self {
2265 Self::DEFAULT
2266 }
2267}
2268#[cfg_attr(feature = "ts", derive(TS))]
2269#[cfg_attr(feature = "ts", ts(export))]
2270#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2271#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2272#[cfg_attr(feature = "serde", serde(tag = "type"))]
2273#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2274#[repr(u32)]
2275#[doc = "Reason for an event error response."]
2276pub enum MavEventErrorReason {
2277 #[doc = "The requested event is not available (anymore)."]
2278 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2279}
2280impl MavEventErrorReason {
2281 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2282}
2283impl Default for MavEventErrorReason {
2284 fn default() -> Self {
2285 Self::DEFAULT
2286 }
2287}
2288#[cfg_attr(feature = "ts", derive(TS))]
2289#[cfg_attr(feature = "ts", ts(export))]
2290#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2291#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2292#[cfg_attr(feature = "serde", serde(tag = "type"))]
2293#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2294#[repr(u32)]
2295#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2296pub enum MavFrame {
2297 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2298 MAV_FRAME_GLOBAL = 0,
2299 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2300 MAV_FRAME_LOCAL_NED = 1,
2301 #[doc = "NOT a coordinate frame, indicates a mission command."]
2302 MAV_FRAME_MISSION = 2,
2303 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2304 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2305 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2306 MAV_FRAME_LOCAL_ENU = 4,
2307 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2308 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2309 MAV_FRAME_GLOBAL_INT = 5,
2310 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2311 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2312 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2313 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2314 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2315 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2316 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2317 MAV_FRAME_BODY_NED = 8,
2318 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2319 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2320 MAV_FRAME_BODY_OFFSET_NED = 9,
2321 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2322 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2323 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2324 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2325 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2326 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2327 MAV_FRAME_BODY_FRD = 12,
2328 #[deprecated = " (Deprecated since 2019-04)"]
2329 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2330 MAV_FRAME_RESERVED_13 = 13,
2331 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2332 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2333 MAV_FRAME_RESERVED_14 = 14,
2334 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2335 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2336 MAV_FRAME_RESERVED_15 = 15,
2337 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2338 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2339 MAV_FRAME_RESERVED_16 = 16,
2340 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2341 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2342 MAV_FRAME_RESERVED_17 = 17,
2343 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2344 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2345 MAV_FRAME_RESERVED_18 = 18,
2346 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2347 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2348 MAV_FRAME_RESERVED_19 = 19,
2349 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2350 MAV_FRAME_LOCAL_FRD = 20,
2351 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2352 MAV_FRAME_LOCAL_FLU = 21,
2353}
2354impl MavFrame {
2355 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2356}
2357impl Default for MavFrame {
2358 fn default() -> Self {
2359 Self::DEFAULT
2360 }
2361}
2362#[cfg_attr(feature = "ts", derive(TS))]
2363#[cfg_attr(feature = "ts", ts(export))]
2364#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2366#[cfg_attr(feature = "serde", serde(tag = "type"))]
2367#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2368#[repr(u32)]
2369#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2370pub enum MavFtpErr {
2371 #[doc = "None: No error"]
2372 MAV_FTP_ERR_NONE = 0,
2373 #[doc = "Fail: Unknown failure"]
2374 MAV_FTP_ERR_FAIL = 1,
2375 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2376 MAV_FTP_ERR_FAILERRNO = 2,
2377 #[doc = "InvalidDataSize: Payload size is invalid"]
2378 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2379 #[doc = "InvalidSession: Session is not currently open"]
2380 MAV_FTP_ERR_INVALIDSESSION = 4,
2381 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2382 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2383 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2384 MAV_FTP_ERR_EOF = 6,
2385 #[doc = "UnknownCommand: Unknown command / opcode"]
2386 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2387 #[doc = "FileExists: File/directory already exists"]
2388 MAV_FTP_ERR_FILEEXISTS = 8,
2389 #[doc = "FileProtected: File/directory is write protected"]
2390 MAV_FTP_ERR_FILEPROTECTED = 9,
2391 #[doc = "FileNotFound: File/directory not found"]
2392 MAV_FTP_ERR_FILENOTFOUND = 10,
2393}
2394impl MavFtpErr {
2395 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2396}
2397impl Default for MavFtpErr {
2398 fn default() -> Self {
2399 Self::DEFAULT
2400 }
2401}
2402#[cfg_attr(feature = "ts", derive(TS))]
2403#[cfg_attr(feature = "ts", ts(export))]
2404#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2406#[cfg_attr(feature = "serde", serde(tag = "type"))]
2407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2408#[repr(u32)]
2409#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2410pub enum MavFtpOpcode {
2411 #[doc = "None. Ignored, always ACKed"]
2412 MAV_FTP_OPCODE_NONE = 0,
2413 #[doc = "TerminateSession: Terminates open Read session"]
2414 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2415 #[doc = "ResetSessions: Terminates all open read sessions"]
2416 MAV_FTP_OPCODE_RESETSESSION = 2,
2417 #[doc = "ListDirectory. List files and directories in path from offset"]
2418 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2419 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2420 MAV_FTP_OPCODE_OPENFILERO = 4,
2421 #[doc = "ReadFile: Reads size bytes from offset in session"]
2422 MAV_FTP_OPCODE_READFILE = 5,
2423 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2424 MAV_FTP_OPCODE_CREATEFILE = 6,
2425 #[doc = "WriteFile: Writes size bytes to offset in session"]
2426 MAV_FTP_OPCODE_WRITEFILE = 7,
2427 #[doc = "RemoveFile: Remove file at path"]
2428 MAV_FTP_OPCODE_REMOVEFILE = 8,
2429 #[doc = "CreateDirectory: Creates directory at path"]
2430 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2431 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2432 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2433 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2434 MAV_FTP_OPCODE_OPENFILEWO = 11,
2435 #[doc = "TruncateFile: Truncate file at path to offset length"]
2436 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2437 #[doc = "Rename: Rename path1 to path2"]
2438 MAV_FTP_OPCODE_RENAME = 13,
2439 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2440 MAV_FTP_OPCODE_CALCFILECRC = 14,
2441 #[doc = "BurstReadFile: Burst download session file"]
2442 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2443 #[doc = "ACK: ACK response"]
2444 MAV_FTP_OPCODE_ACK = 128,
2445 #[doc = "NAK: NAK response"]
2446 MAV_FTP_OPCODE_NAK = 129,
2447}
2448impl MavFtpOpcode {
2449 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2450}
2451impl Default for MavFtpOpcode {
2452 fn default() -> Self {
2453 Self::DEFAULT
2454 }
2455}
2456#[cfg_attr(feature = "ts", derive(TS))]
2457#[cfg_attr(feature = "ts", ts(export))]
2458#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2459#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2460#[cfg_attr(feature = "serde", serde(tag = "type"))]
2461#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2462#[repr(u32)]
2463#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2464pub enum MavFuelType {
2465 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2466 MAV_FUEL_TYPE_UNKNOWN = 0,
2467 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2468 MAV_FUEL_TYPE_LIQUID = 1,
2469 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2470 MAV_FUEL_TYPE_GAS = 2,
2471}
2472impl MavFuelType {
2473 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2474}
2475impl Default for MavFuelType {
2476 fn default() -> Self {
2477 Self::DEFAULT
2478 }
2479}
2480bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2481impl MavGeneratorStatusFlag {
2482 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2483}
2484impl Default for MavGeneratorStatusFlag {
2485 fn default() -> Self {
2486 Self::DEFAULT
2487 }
2488}
2489#[cfg_attr(feature = "ts", derive(TS))]
2490#[cfg_attr(feature = "ts", ts(export))]
2491#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2492#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2493#[cfg_attr(feature = "serde", serde(tag = "type"))]
2494#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2495#[repr(u32)]
2496#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2497pub enum MavGoto {
2498 #[doc = "Hold at the current position."]
2499 MAV_GOTO_DO_HOLD = 0,
2500 #[doc = "Continue with the next item in mission execution."]
2501 MAV_GOTO_DO_CONTINUE = 1,
2502 #[doc = "Hold at the current position of the system"]
2503 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2504 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2505 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2506}
2507impl MavGoto {
2508 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2509}
2510impl Default for MavGoto {
2511 fn default() -> Self {
2512 Self::DEFAULT
2513 }
2514}
2515#[cfg_attr(feature = "ts", derive(TS))]
2516#[cfg_attr(feature = "ts", ts(export))]
2517#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2518#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2519#[cfg_attr(feature = "serde", serde(tag = "type"))]
2520#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2521#[repr(u32)]
2522#[doc = "Enumeration of landed detector states"]
2523pub enum MavLandedState {
2524 #[doc = "MAV landed state is unknown"]
2525 MAV_LANDED_STATE_UNDEFINED = 0,
2526 #[doc = "MAV is landed (on ground)"]
2527 MAV_LANDED_STATE_ON_GROUND = 1,
2528 #[doc = "MAV is in air"]
2529 MAV_LANDED_STATE_IN_AIR = 2,
2530 #[doc = "MAV currently taking off"]
2531 MAV_LANDED_STATE_TAKEOFF = 3,
2532 #[doc = "MAV currently landing"]
2533 MAV_LANDED_STATE_LANDING = 4,
2534}
2535impl MavLandedState {
2536 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2537}
2538impl Default for MavLandedState {
2539 fn default() -> Self {
2540 Self::DEFAULT
2541 }
2542}
2543#[cfg_attr(feature = "ts", derive(TS))]
2544#[cfg_attr(feature = "ts", ts(export))]
2545#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2546#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2547#[cfg_attr(feature = "serde", serde(tag = "type"))]
2548#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2549#[repr(u32)]
2550#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2551pub enum MavMissionResult {
2552 #[doc = "mission accepted OK"]
2553 MAV_MISSION_ACCEPTED = 0,
2554 #[doc = "Generic error / not accepting mission commands at all right now."]
2555 MAV_MISSION_ERROR = 1,
2556 #[doc = "Coordinate frame is not supported."]
2557 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2558 #[doc = "Command is not supported."]
2559 MAV_MISSION_UNSUPPORTED = 3,
2560 #[doc = "Mission items exceed storage space."]
2561 MAV_MISSION_NO_SPACE = 4,
2562 #[doc = "One of the parameters has an invalid value."]
2563 MAV_MISSION_INVALID = 5,
2564 #[doc = "param1 has an invalid value."]
2565 MAV_MISSION_INVALID_PARAM1 = 6,
2566 #[doc = "param2 has an invalid value."]
2567 MAV_MISSION_INVALID_PARAM2 = 7,
2568 #[doc = "param3 has an invalid value."]
2569 MAV_MISSION_INVALID_PARAM3 = 8,
2570 #[doc = "param4 has an invalid value."]
2571 MAV_MISSION_INVALID_PARAM4 = 9,
2572 #[doc = "x / param5 has an invalid value."]
2573 MAV_MISSION_INVALID_PARAM5_X = 10,
2574 #[doc = "y / param6 has an invalid value."]
2575 MAV_MISSION_INVALID_PARAM6_Y = 11,
2576 #[doc = "z / param7 has an invalid value."]
2577 MAV_MISSION_INVALID_PARAM7 = 12,
2578 #[doc = "Mission item received out of sequence"]
2579 MAV_MISSION_INVALID_SEQUENCE = 13,
2580 #[doc = "Not accepting any mission commands from this communication partner."]
2581 MAV_MISSION_DENIED = 14,
2582 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2583 MAV_MISSION_OPERATION_CANCELLED = 15,
2584}
2585impl MavMissionResult {
2586 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2587}
2588impl Default for MavMissionResult {
2589 fn default() -> Self {
2590 Self::DEFAULT
2591 }
2592}
2593#[cfg_attr(feature = "ts", derive(TS))]
2594#[cfg_attr(feature = "ts", ts(export))]
2595#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2596#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2597#[cfg_attr(feature = "serde", serde(tag = "type"))]
2598#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2599#[repr(u32)]
2600#[doc = "Type of mission items being requested/sent in mission protocol."]
2601pub enum MavMissionType {
2602 #[doc = "Items are mission commands for main mission."]
2603 MAV_MISSION_TYPE_MISSION = 0,
2604 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2605 MAV_MISSION_TYPE_FENCE = 1,
2606 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2607 MAV_MISSION_TYPE_RALLY = 2,
2608 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2609 MAV_MISSION_TYPE_ALL = 255,
2610}
2611impl MavMissionType {
2612 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2613}
2614impl Default for MavMissionType {
2615 fn default() -> Self {
2616 Self::DEFAULT
2617 }
2618}
2619#[cfg_attr(feature = "ts", derive(TS))]
2620#[cfg_attr(feature = "ts", ts(export))]
2621#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2622#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2623#[cfg_attr(feature = "serde", serde(tag = "type"))]
2624#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2625#[repr(u32)]
2626#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2627pub enum MavMode {
2628 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2629 MAV_MODE_PREFLIGHT = 0,
2630 #[doc = "System is allowed to be active, under assisted RC control."]
2631 MAV_MODE_STABILIZE_DISARMED = 80,
2632 #[doc = "System is allowed to be active, under assisted RC control."]
2633 MAV_MODE_STABILIZE_ARMED = 208,
2634 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2635 MAV_MODE_MANUAL_DISARMED = 64,
2636 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2637 MAV_MODE_MANUAL_ARMED = 192,
2638 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2639 MAV_MODE_GUIDED_DISARMED = 88,
2640 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2641 MAV_MODE_GUIDED_ARMED = 216,
2642 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2643 MAV_MODE_AUTO_DISARMED = 92,
2644 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2645 MAV_MODE_AUTO_ARMED = 220,
2646 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2647 MAV_MODE_TEST_DISARMED = 66,
2648 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2649 MAV_MODE_TEST_ARMED = 194,
2650}
2651impl MavMode {
2652 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2653}
2654impl Default for MavMode {
2655 fn default() -> Self {
2656 Self::DEFAULT
2657 }
2658}
2659bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2660impl MavModeFlag {
2661 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2662}
2663impl Default for MavModeFlag {
2664 fn default() -> Self {
2665 Self::DEFAULT
2666 }
2667}
2668#[cfg_attr(feature = "ts", derive(TS))]
2669#[cfg_attr(feature = "ts", ts(export))]
2670#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2671#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2672#[cfg_attr(feature = "serde", serde(tag = "type"))]
2673#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2674#[repr(u32)]
2675#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2676pub enum MavModeFlagDecodePosition {
2677 #[doc = "First bit: 10000000"]
2678 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2679 #[doc = "Second bit: 01000000"]
2680 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2681 #[doc = "Third bit: 00100000"]
2682 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2683 #[doc = "Fourth bit: 00010000"]
2684 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2685 #[doc = "Fifth bit: 00001000"]
2686 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2687 #[doc = "Sixth bit: 00000100"]
2688 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2689 #[doc = "Seventh bit: 00000010"]
2690 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2691 #[doc = "Eighth bit: 00000001"]
2692 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2693}
2694impl MavModeFlagDecodePosition {
2695 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2696}
2697impl Default for MavModeFlagDecodePosition {
2698 fn default() -> Self {
2699 Self::DEFAULT
2700 }
2701}
2702bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2703impl MavModeProperty {
2704 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2705}
2706impl Default for MavModeProperty {
2707 fn default() -> Self {
2708 Self::DEFAULT
2709 }
2710}
2711#[cfg_attr(feature = "ts", derive(TS))]
2712#[cfg_attr(feature = "ts", ts(export))]
2713#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2714#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2715#[cfg_attr(feature = "serde", serde(tag = "type"))]
2716#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2717#[repr(u32)]
2718#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2719#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2720pub enum MavMountMode {
2721 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2722 MAV_MOUNT_MODE_RETRACT = 0,
2723 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2724 MAV_MOUNT_MODE_NEUTRAL = 1,
2725 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2726 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2727 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2728 MAV_MOUNT_MODE_RC_TARGETING = 3,
2729 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2730 MAV_MOUNT_MODE_GPS_POINT = 4,
2731 #[doc = "Gimbal tracks system with specified system ID"]
2732 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2733 #[doc = "Gimbal tracks home position"]
2734 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2735}
2736impl MavMountMode {
2737 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2738}
2739impl Default for MavMountMode {
2740 fn default() -> Self {
2741 Self::DEFAULT
2742 }
2743}
2744#[cfg_attr(feature = "ts", derive(TS))]
2745#[cfg_attr(feature = "ts", ts(export))]
2746#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2747#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2748#[cfg_attr(feature = "serde", serde(tag = "type"))]
2749#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2750#[repr(u32)]
2751pub enum MavOdidArmStatus {
2752 #[doc = "Passing arming checks."]
2753 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2754 #[doc = "Generic arming failure, see error string for details."]
2755 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2756}
2757impl MavOdidArmStatus {
2758 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2759}
2760impl Default for MavOdidArmStatus {
2761 fn default() -> Self {
2762 Self::DEFAULT
2763 }
2764}
2765#[cfg_attr(feature = "ts", derive(TS))]
2766#[cfg_attr(feature = "ts", ts(export))]
2767#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2768#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2769#[cfg_attr(feature = "serde", serde(tag = "type"))]
2770#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2771#[repr(u32)]
2772pub enum MavOdidAuthType {
2773 #[doc = "No authentication type is specified."]
2774 MAV_ODID_AUTH_TYPE_NONE = 0,
2775 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2776 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2777 #[doc = "Signature for the Operator ID."]
2778 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2779 #[doc = "Signature for the entire message set."]
2780 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2781 #[doc = "Authentication is provided by Network Remote ID."]
2782 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2783 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2784 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2785}
2786impl MavOdidAuthType {
2787 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2788}
2789impl Default for MavOdidAuthType {
2790 fn default() -> Self {
2791 Self::DEFAULT
2792 }
2793}
2794#[cfg_attr(feature = "ts", derive(TS))]
2795#[cfg_attr(feature = "ts", ts(export))]
2796#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2797#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2798#[cfg_attr(feature = "serde", serde(tag = "type"))]
2799#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2800#[repr(u32)]
2801pub enum MavOdidCategoryEu {
2802 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2803 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2804 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2805 MAV_ODID_CATEGORY_EU_OPEN = 1,
2806 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2807 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2808 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2809 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2810}
2811impl MavOdidCategoryEu {
2812 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2813}
2814impl Default for MavOdidCategoryEu {
2815 fn default() -> Self {
2816 Self::DEFAULT
2817 }
2818}
2819#[cfg_attr(feature = "ts", derive(TS))]
2820#[cfg_attr(feature = "ts", ts(export))]
2821#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2822#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2823#[cfg_attr(feature = "serde", serde(tag = "type"))]
2824#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2825#[repr(u32)]
2826pub enum MavOdidClassEu {
2827 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2828 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2829 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2830 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2831 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2832 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2833 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2834 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2835 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2836 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2837 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2838 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2839 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2840 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2841 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2842 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2843}
2844impl MavOdidClassEu {
2845 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2846}
2847impl Default for MavOdidClassEu {
2848 fn default() -> Self {
2849 Self::DEFAULT
2850 }
2851}
2852#[cfg_attr(feature = "ts", derive(TS))]
2853#[cfg_attr(feature = "ts", ts(export))]
2854#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2855#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2856#[cfg_attr(feature = "serde", serde(tag = "type"))]
2857#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2858#[repr(u32)]
2859pub enum MavOdidClassificationType {
2860 #[doc = "The classification type for the UA is undeclared."]
2861 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2862 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2863 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2864}
2865impl MavOdidClassificationType {
2866 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2867}
2868impl Default for MavOdidClassificationType {
2869 fn default() -> Self {
2870 Self::DEFAULT
2871 }
2872}
2873#[cfg_attr(feature = "ts", derive(TS))]
2874#[cfg_attr(feature = "ts", ts(export))]
2875#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2876#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2877#[cfg_attr(feature = "serde", serde(tag = "type"))]
2878#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2879#[repr(u32)]
2880pub enum MavOdidDescType {
2881 #[doc = "Optional free-form text description of the purpose of the flight."]
2882 MAV_ODID_DESC_TYPE_TEXT = 0,
2883 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2884 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2885 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2886 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2887}
2888impl MavOdidDescType {
2889 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2890}
2891impl Default for MavOdidDescType {
2892 fn default() -> Self {
2893 Self::DEFAULT
2894 }
2895}
2896#[cfg_attr(feature = "ts", derive(TS))]
2897#[cfg_attr(feature = "ts", ts(export))]
2898#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2899#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2900#[cfg_attr(feature = "serde", serde(tag = "type"))]
2901#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2902#[repr(u32)]
2903pub enum MavOdidHeightRef {
2904 #[doc = "The height field is relative to the take-off location."]
2905 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2906 #[doc = "The height field is relative to ground."]
2907 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2908}
2909impl MavOdidHeightRef {
2910 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2911}
2912impl Default for MavOdidHeightRef {
2913 fn default() -> Self {
2914 Self::DEFAULT
2915 }
2916}
2917#[cfg_attr(feature = "ts", derive(TS))]
2918#[cfg_attr(feature = "ts", ts(export))]
2919#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2920#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2921#[cfg_attr(feature = "serde", serde(tag = "type"))]
2922#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2923#[repr(u32)]
2924pub enum MavOdidHorAcc {
2925 #[doc = "The horizontal accuracy is unknown."]
2926 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2927 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2928 MAV_ODID_HOR_ACC_10NM = 1,
2929 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2930 MAV_ODID_HOR_ACC_4NM = 2,
2931 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2932 MAV_ODID_HOR_ACC_2NM = 3,
2933 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2934 MAV_ODID_HOR_ACC_1NM = 4,
2935 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2936 MAV_ODID_HOR_ACC_0_5NM = 5,
2937 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2938 MAV_ODID_HOR_ACC_0_3NM = 6,
2939 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2940 MAV_ODID_HOR_ACC_0_1NM = 7,
2941 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2942 MAV_ODID_HOR_ACC_0_05NM = 8,
2943 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2944 MAV_ODID_HOR_ACC_30_METER = 9,
2945 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2946 MAV_ODID_HOR_ACC_10_METER = 10,
2947 #[doc = "The horizontal accuracy is smaller than 3 meter."]
2948 MAV_ODID_HOR_ACC_3_METER = 11,
2949 #[doc = "The horizontal accuracy is smaller than 1 meter."]
2950 MAV_ODID_HOR_ACC_1_METER = 12,
2951}
2952impl MavOdidHorAcc {
2953 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
2954}
2955impl Default for MavOdidHorAcc {
2956 fn default() -> Self {
2957 Self::DEFAULT
2958 }
2959}
2960#[cfg_attr(feature = "ts", derive(TS))]
2961#[cfg_attr(feature = "ts", ts(export))]
2962#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2963#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2964#[cfg_attr(feature = "serde", serde(tag = "type"))]
2965#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2966#[repr(u32)]
2967pub enum MavOdidIdType {
2968 #[doc = "No type defined."]
2969 MAV_ODID_ID_TYPE_NONE = 0,
2970 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
2971 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
2972 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
2973 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
2974 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
2975 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
2976 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
2977 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
2978}
2979impl MavOdidIdType {
2980 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
2981}
2982impl Default for MavOdidIdType {
2983 fn default() -> Self {
2984 Self::DEFAULT
2985 }
2986}
2987#[cfg_attr(feature = "ts", derive(TS))]
2988#[cfg_attr(feature = "ts", ts(export))]
2989#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2990#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2991#[cfg_attr(feature = "serde", serde(tag = "type"))]
2992#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2993#[repr(u32)]
2994pub enum MavOdidOperatorIdType {
2995 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
2996 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
2997}
2998impl MavOdidOperatorIdType {
2999 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
3000}
3001impl Default for MavOdidOperatorIdType {
3002 fn default() -> Self {
3003 Self::DEFAULT
3004 }
3005}
3006#[cfg_attr(feature = "ts", derive(TS))]
3007#[cfg_attr(feature = "ts", ts(export))]
3008#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3009#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3010#[cfg_attr(feature = "serde", serde(tag = "type"))]
3011#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3012#[repr(u32)]
3013pub enum MavOdidOperatorLocationType {
3014 #[doc = "The location/altitude of the operator is the same as the take-off location."]
3015 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
3016 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
3017 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
3018 #[doc = "The location/altitude of the operator are fixed values."]
3019 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
3020}
3021impl MavOdidOperatorLocationType {
3022 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
3023}
3024impl Default for MavOdidOperatorLocationType {
3025 fn default() -> Self {
3026 Self::DEFAULT
3027 }
3028}
3029#[cfg_attr(feature = "ts", derive(TS))]
3030#[cfg_attr(feature = "ts", ts(export))]
3031#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3033#[cfg_attr(feature = "serde", serde(tag = "type"))]
3034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3035#[repr(u32)]
3036pub enum MavOdidSpeedAcc {
3037 #[doc = "The speed accuracy is unknown."]
3038 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
3039 #[doc = "The speed accuracy is smaller than 10 meters per second."]
3040 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
3041 #[doc = "The speed accuracy is smaller than 3 meters per second."]
3042 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
3043 #[doc = "The speed accuracy is smaller than 1 meters per second."]
3044 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
3045 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
3046 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
3047}
3048impl MavOdidSpeedAcc {
3049 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
3050}
3051impl Default for MavOdidSpeedAcc {
3052 fn default() -> Self {
3053 Self::DEFAULT
3054 }
3055}
3056#[cfg_attr(feature = "ts", derive(TS))]
3057#[cfg_attr(feature = "ts", ts(export))]
3058#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3059#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3060#[cfg_attr(feature = "serde", serde(tag = "type"))]
3061#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3062#[repr(u32)]
3063pub enum MavOdidStatus {
3064 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
3065 MAV_ODID_STATUS_UNDECLARED = 0,
3066 #[doc = "The UA is on the ground."]
3067 MAV_ODID_STATUS_GROUND = 1,
3068 #[doc = "The UA is in the air."]
3069 MAV_ODID_STATUS_AIRBORNE = 2,
3070 #[doc = "The UA is having an emergency."]
3071 MAV_ODID_STATUS_EMERGENCY = 3,
3072 #[doc = "The remote ID system is failing or unreliable in some way."]
3073 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
3074}
3075impl MavOdidStatus {
3076 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
3077}
3078impl Default for MavOdidStatus {
3079 fn default() -> Self {
3080 Self::DEFAULT
3081 }
3082}
3083#[cfg_attr(feature = "ts", derive(TS))]
3084#[cfg_attr(feature = "ts", ts(export))]
3085#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3086#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3087#[cfg_attr(feature = "serde", serde(tag = "type"))]
3088#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3089#[repr(u32)]
3090pub enum MavOdidTimeAcc {
3091 #[doc = "The timestamp accuracy is unknown."]
3092 MAV_ODID_TIME_ACC_UNKNOWN = 0,
3093 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
3094 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
3095 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
3096 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
3097 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
3098 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
3099 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
3100 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
3101 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
3102 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
3103 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
3104 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
3105 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
3106 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
3107 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
3108 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
3109 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
3110 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
3111 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
3112 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
3113 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
3114 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
3115 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
3116 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
3117 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
3118 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
3119 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
3120 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
3121 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
3122 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
3123}
3124impl MavOdidTimeAcc {
3125 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
3126}
3127impl Default for MavOdidTimeAcc {
3128 fn default() -> Self {
3129 Self::DEFAULT
3130 }
3131}
3132#[cfg_attr(feature = "ts", derive(TS))]
3133#[cfg_attr(feature = "ts", ts(export))]
3134#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3135#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3136#[cfg_attr(feature = "serde", serde(tag = "type"))]
3137#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3138#[repr(u32)]
3139pub enum MavOdidUaType {
3140 #[doc = "No UA (Unmanned Aircraft) type defined."]
3141 MAV_ODID_UA_TYPE_NONE = 0,
3142 #[doc = "Aeroplane/Airplane. Fixed wing."]
3143 MAV_ODID_UA_TYPE_AEROPLANE = 1,
3144 #[doc = "Helicopter or multirotor."]
3145 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
3146 #[doc = "Gyroplane."]
3147 MAV_ODID_UA_TYPE_GYROPLANE = 3,
3148 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
3149 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
3150 #[doc = "Ornithopter."]
3151 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3152 #[doc = "Glider."]
3153 MAV_ODID_UA_TYPE_GLIDER = 6,
3154 #[doc = "Kite."]
3155 MAV_ODID_UA_TYPE_KITE = 7,
3156 #[doc = "Free Balloon."]
3157 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3158 #[doc = "Captive Balloon."]
3159 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3160 #[doc = "Airship. E.g. a blimp."]
3161 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3162 #[doc = "Free Fall/Parachute (unpowered)."]
3163 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3164 #[doc = "Rocket."]
3165 MAV_ODID_UA_TYPE_ROCKET = 12,
3166 #[doc = "Tethered powered aircraft."]
3167 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3168 #[doc = "Ground Obstacle."]
3169 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3170 #[doc = "Other type of aircraft not listed earlier."]
3171 MAV_ODID_UA_TYPE_OTHER = 15,
3172}
3173impl MavOdidUaType {
3174 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3175}
3176impl Default for MavOdidUaType {
3177 fn default() -> Self {
3178 Self::DEFAULT
3179 }
3180}
3181#[cfg_attr(feature = "ts", derive(TS))]
3182#[cfg_attr(feature = "ts", ts(export))]
3183#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3184#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3185#[cfg_attr(feature = "serde", serde(tag = "type"))]
3186#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3187#[repr(u32)]
3188pub enum MavOdidVerAcc {
3189 #[doc = "The vertical accuracy is unknown."]
3190 MAV_ODID_VER_ACC_UNKNOWN = 0,
3191 #[doc = "The vertical accuracy is smaller than 150 meter."]
3192 MAV_ODID_VER_ACC_150_METER = 1,
3193 #[doc = "The vertical accuracy is smaller than 45 meter."]
3194 MAV_ODID_VER_ACC_45_METER = 2,
3195 #[doc = "The vertical accuracy is smaller than 25 meter."]
3196 MAV_ODID_VER_ACC_25_METER = 3,
3197 #[doc = "The vertical accuracy is smaller than 10 meter."]
3198 MAV_ODID_VER_ACC_10_METER = 4,
3199 #[doc = "The vertical accuracy is smaller than 3 meter."]
3200 MAV_ODID_VER_ACC_3_METER = 5,
3201 #[doc = "The vertical accuracy is smaller than 1 meter."]
3202 MAV_ODID_VER_ACC_1_METER = 6,
3203}
3204impl MavOdidVerAcc {
3205 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3206}
3207impl Default for MavOdidVerAcc {
3208 fn default() -> Self {
3209 Self::DEFAULT
3210 }
3211}
3212#[cfg_attr(feature = "ts", derive(TS))]
3213#[cfg_attr(feature = "ts", ts(export))]
3214#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3216#[cfg_attr(feature = "serde", serde(tag = "type"))]
3217#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3218#[repr(u32)]
3219#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3220pub enum MavParamExtType {
3221 #[doc = "8-bit unsigned integer"]
3222 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3223 #[doc = "8-bit signed integer"]
3224 MAV_PARAM_EXT_TYPE_INT8 = 2,
3225 #[doc = "16-bit unsigned integer"]
3226 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3227 #[doc = "16-bit signed integer"]
3228 MAV_PARAM_EXT_TYPE_INT16 = 4,
3229 #[doc = "32-bit unsigned integer"]
3230 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3231 #[doc = "32-bit signed integer"]
3232 MAV_PARAM_EXT_TYPE_INT32 = 6,
3233 #[doc = "64-bit unsigned integer"]
3234 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3235 #[doc = "64-bit signed integer"]
3236 MAV_PARAM_EXT_TYPE_INT64 = 8,
3237 #[doc = "32-bit floating-point"]
3238 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3239 #[doc = "64-bit floating-point"]
3240 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3241 #[doc = "Custom Type"]
3242 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3243}
3244impl MavParamExtType {
3245 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3246}
3247impl Default for MavParamExtType {
3248 fn default() -> Self {
3249 Self::DEFAULT
3250 }
3251}
3252#[cfg_attr(feature = "ts", derive(TS))]
3253#[cfg_attr(feature = "ts", ts(export))]
3254#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3256#[cfg_attr(feature = "serde", serde(tag = "type"))]
3257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3258#[repr(u32)]
3259#[doc = "Specifies the datatype of a MAVLink parameter."]
3260pub enum MavParamType {
3261 #[doc = "8-bit unsigned integer"]
3262 MAV_PARAM_TYPE_UINT8 = 1,
3263 #[doc = "8-bit signed integer"]
3264 MAV_PARAM_TYPE_INT8 = 2,
3265 #[doc = "16-bit unsigned integer"]
3266 MAV_PARAM_TYPE_UINT16 = 3,
3267 #[doc = "16-bit signed integer"]
3268 MAV_PARAM_TYPE_INT16 = 4,
3269 #[doc = "32-bit unsigned integer"]
3270 MAV_PARAM_TYPE_UINT32 = 5,
3271 #[doc = "32-bit signed integer"]
3272 MAV_PARAM_TYPE_INT32 = 6,
3273 #[doc = "64-bit unsigned integer"]
3274 MAV_PARAM_TYPE_UINT64 = 7,
3275 #[doc = "64-bit signed integer"]
3276 MAV_PARAM_TYPE_INT64 = 8,
3277 #[doc = "32-bit floating-point"]
3278 MAV_PARAM_TYPE_REAL32 = 9,
3279 #[doc = "64-bit floating-point"]
3280 MAV_PARAM_TYPE_REAL64 = 10,
3281}
3282impl MavParamType {
3283 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3284}
3285impl Default for MavParamType {
3286 fn default() -> Self {
3287 Self::DEFAULT
3288 }
3289}
3290bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3291impl MavPowerStatus {
3292 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3293}
3294impl Default for MavPowerStatus {
3295 fn default() -> Self {
3296 Self::DEFAULT
3297 }
3298}
3299#[cfg_attr(feature = "ts", derive(TS))]
3300#[cfg_attr(feature = "ts", ts(export))]
3301#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3302#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3303#[cfg_attr(feature = "serde", serde(tag = "type"))]
3304#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3305#[repr(u32)]
3306#[doc = "Action required when performing CMD_PREFLIGHT_STORAGE"]
3307pub enum MavPreflightStorageAction {
3308 #[doc = "Read all parameters from storage"]
3309 MAV_PFS_CMD_READ_ALL = 0,
3310 #[doc = "Write all parameters to storage"]
3311 MAV_PFS_CMD_WRITE_ALL = 1,
3312 #[doc = "Clear all parameters in storage"]
3313 MAV_PFS_CMD_CLEAR_ALL = 2,
3314 #[doc = "Read specific parameters from storage"]
3315 MAV_PFS_CMD_READ_SPECIFIC = 3,
3316 #[doc = "Write specific parameters to storage"]
3317 MAV_PFS_CMD_WRITE_SPECIFIC = 4,
3318 #[doc = "Clear specific parameters in storage"]
3319 MAV_PFS_CMD_CLEAR_SPECIFIC = 5,
3320 #[doc = "do nothing"]
3321 MAV_PFS_CMD_DO_NOTHING = 6,
3322}
3323impl MavPreflightStorageAction {
3324 pub const DEFAULT: Self = Self::MAV_PFS_CMD_READ_ALL;
3325}
3326impl Default for MavPreflightStorageAction {
3327 fn default() -> Self {
3328 Self::DEFAULT
3329 }
3330}
3331bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3332impl MavProtocolCapability {
3333 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3334}
3335impl Default for MavProtocolCapability {
3336 fn default() -> Self {
3337 Self::DEFAULT
3338 }
3339}
3340#[cfg_attr(feature = "ts", derive(TS))]
3341#[cfg_attr(feature = "ts", ts(export))]
3342#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3343#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3344#[cfg_attr(feature = "serde", serde(tag = "type"))]
3345#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3346#[repr(u32)]
3347#[doc = "Result from a MAVLink command (MAV_CMD)"]
3348pub enum MavResult {
3349 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3350 MAV_RESULT_ACCEPTED = 0,
3351 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3352 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3353 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3354 MAV_RESULT_DENIED = 2,
3355 #[doc = "Command is not supported (unknown)."]
3356 MAV_RESULT_UNSUPPORTED = 3,
3357 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3358 MAV_RESULT_FAILED = 4,
3359 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3360 MAV_RESULT_IN_PROGRESS = 5,
3361 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3362 MAV_RESULT_CANCELLED = 6,
3363 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3364 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3365 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3366 MAV_RESULT_COMMAND_INT_ONLY = 8,
3367 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3368 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3369}
3370impl MavResult {
3371 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3372}
3373impl Default for MavResult {
3374 fn default() -> Self {
3375 Self::DEFAULT
3376 }
3377}
3378#[cfg_attr(feature = "ts", derive(TS))]
3379#[cfg_attr(feature = "ts", ts(export))]
3380#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3381#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3382#[cfg_attr(feature = "serde", serde(tag = "type"))]
3383#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3384#[repr(u32)]
3385#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3386#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3387pub enum MavRoi {
3388 #[doc = "No region of interest."]
3389 MAV_ROI_NONE = 0,
3390 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3391 MAV_ROI_WPNEXT = 1,
3392 #[doc = "Point toward given waypoint."]
3393 MAV_ROI_WPINDEX = 2,
3394 #[doc = "Point toward fixed location."]
3395 MAV_ROI_LOCATION = 3,
3396 #[doc = "Point toward of given id."]
3397 MAV_ROI_TARGET = 4,
3398}
3399impl MavRoi {
3400 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3401}
3402impl Default for MavRoi {
3403 fn default() -> Self {
3404 Self::DEFAULT
3405 }
3406}
3407#[cfg_attr(feature = "ts", derive(TS))]
3408#[cfg_attr(feature = "ts", ts(export))]
3409#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3410#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3411#[cfg_attr(feature = "serde", serde(tag = "type"))]
3412#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3413#[repr(u32)]
3414#[doc = "Enumeration of sensor orientation, according to its rotations"]
3415pub enum MavSensorOrientation {
3416 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3417 MAV_SENSOR_ROTATION_NONE = 0,
3418 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3419 MAV_SENSOR_ROTATION_YAW_45 = 1,
3420 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3421 MAV_SENSOR_ROTATION_YAW_90 = 2,
3422 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3423 MAV_SENSOR_ROTATION_YAW_135 = 3,
3424 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3425 MAV_SENSOR_ROTATION_YAW_180 = 4,
3426 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3427 MAV_SENSOR_ROTATION_YAW_225 = 5,
3428 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3429 MAV_SENSOR_ROTATION_YAW_270 = 6,
3430 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3431 MAV_SENSOR_ROTATION_YAW_315 = 7,
3432 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3433 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3434 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3435 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3436 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3437 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3438 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3439 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3440 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3441 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3442 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3443 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3444 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3445 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3446 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3447 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3448 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3449 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3450 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3451 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3452 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3453 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3454 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3455 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3456 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3457 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3458 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3459 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3460 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3461 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3462 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3463 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3464 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3465 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3466 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3467 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3468 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3469 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3470 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3471 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3472 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3473 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3474 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3475 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3476 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3477 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3478 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3479 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3480 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3481 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3482 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3483 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3484 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3485 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3486 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3487 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3488 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3489 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3490 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3491 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3492 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3493 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3494 #[doc = "Pitch: 315"]
3495 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3496 #[doc = "Roll: 90, Pitch: 315"]
3497 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3498 #[doc = "Custom orientation"]
3499 MAV_SENSOR_ROTATION_CUSTOM = 100,
3500}
3501impl MavSensorOrientation {
3502 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3503}
3504impl Default for MavSensorOrientation {
3505 fn default() -> Self {
3506 Self::DEFAULT
3507 }
3508}
3509#[cfg_attr(feature = "ts", derive(TS))]
3510#[cfg_attr(feature = "ts", ts(export))]
3511#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3512#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3513#[cfg_attr(feature = "serde", serde(tag = "type"))]
3514#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3515#[repr(u32)]
3516#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3517pub enum MavSeverity {
3518 #[doc = "System is unusable. This is a \"panic\" condition."]
3519 MAV_SEVERITY_EMERGENCY = 0,
3520 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3521 MAV_SEVERITY_ALERT = 1,
3522 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3523 MAV_SEVERITY_CRITICAL = 2,
3524 #[doc = "Indicates an error in secondary/redundant systems."]
3525 MAV_SEVERITY_ERROR = 3,
3526 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3527 MAV_SEVERITY_WARNING = 4,
3528 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3529 MAV_SEVERITY_NOTICE = 5,
3530 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3531 MAV_SEVERITY_INFO = 6,
3532 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3533 MAV_SEVERITY_DEBUG = 7,
3534}
3535impl MavSeverity {
3536 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3537}
3538impl Default for MavSeverity {
3539 fn default() -> Self {
3540 Self::DEFAULT
3541 }
3542}
3543#[cfg_attr(feature = "ts", derive(TS))]
3544#[cfg_attr(feature = "ts", ts(export))]
3545#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3546#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3547#[cfg_attr(feature = "serde", serde(tag = "type"))]
3548#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3549#[repr(u32)]
3550#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3551pub enum MavStandardMode {
3552 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3553 MAV_STANDARD_MODE_NON_STANDARD = 0,
3554 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3555 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3556 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3557 MAV_STANDARD_MODE_ORBIT = 2,
3558 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3559 MAV_STANDARD_MODE_CRUISE = 3,
3560 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3561 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3562 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3563 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3564 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3565 MAV_STANDARD_MODE_MISSION = 6,
3566 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3567 MAV_STANDARD_MODE_LAND = 7,
3568 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3569 MAV_STANDARD_MODE_TAKEOFF = 8,
3570}
3571impl MavStandardMode {
3572 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3573}
3574impl Default for MavStandardMode {
3575 fn default() -> Self {
3576 Self::DEFAULT
3577 }
3578}
3579#[cfg_attr(feature = "ts", derive(TS))]
3580#[cfg_attr(feature = "ts", ts(export))]
3581#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3582#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3583#[cfg_attr(feature = "serde", serde(tag = "type"))]
3584#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3585#[repr(u32)]
3586pub enum MavState {
3587 #[doc = "Uninitialized system, state is unknown."]
3588 MAV_STATE_UNINIT = 0,
3589 #[doc = "System is booting up."]
3590 MAV_STATE_BOOT = 1,
3591 #[doc = "System is calibrating and not flight-ready."]
3592 MAV_STATE_CALIBRATING = 2,
3593 #[doc = "System is grounded and on standby. It can be launched any time."]
3594 MAV_STATE_STANDBY = 3,
3595 #[doc = "System is active and might be already airborne. Motors are engaged."]
3596 MAV_STATE_ACTIVE = 4,
3597 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3598 MAV_STATE_CRITICAL = 5,
3599 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3600 MAV_STATE_EMERGENCY = 6,
3601 #[doc = "System just initialized its power-down sequence, will shut down now."]
3602 MAV_STATE_POWEROFF = 7,
3603 #[doc = "System is terminating itself (failsafe or commanded)."]
3604 MAV_STATE_FLIGHT_TERMINATION = 8,
3605}
3606impl MavState {
3607 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3608}
3609impl Default for MavState {
3610 fn default() -> Self {
3611 Self::DEFAULT
3612 }
3613}
3614bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3615impl MavSysStatusSensor {
3616 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3617}
3618impl Default for MavSysStatusSensor {
3619 fn default() -> Self {
3620 Self::DEFAULT
3621 }
3622}
3623bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3624impl MavSysStatusSensorExtended {
3625 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3626}
3627impl Default for MavSysStatusSensorExtended {
3628 fn default() -> Self {
3629 Self::DEFAULT
3630 }
3631}
3632#[cfg_attr(feature = "ts", derive(TS))]
3633#[cfg_attr(feature = "ts", ts(export))]
3634#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3635#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3636#[cfg_attr(feature = "serde", serde(tag = "type"))]
3637#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3638#[repr(u32)]
3639pub enum MavTunnelPayloadType {
3640 #[doc = "Encoding of payload unknown."]
3641 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3642 #[doc = "Registered for STorM32 gimbal controller."]
3643 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3644 #[doc = "Registered for STorM32 gimbal controller."]
3645 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3646 #[doc = "Registered for STorM32 gimbal controller."]
3647 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3648 #[doc = "Registered for STorM32 gimbal controller."]
3649 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3650 #[doc = "Registered for STorM32 gimbal controller."]
3651 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3652 #[doc = "Registered for STorM32 gimbal controller."]
3653 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3654 #[doc = "Registered for STorM32 gimbal controller."]
3655 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3656 #[doc = "Registered for STorM32 gimbal controller."]
3657 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3658 #[doc = "Registered for STorM32 gimbal controller."]
3659 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3660 #[doc = "Registered for STorM32 gimbal controller."]
3661 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3662 #[doc = "Registered for ModalAI remote OSD protocol."]
3663 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3664 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3665 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3666 #[doc = "Registered for ModalAI vendor use."]
3667 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3668}
3669impl MavTunnelPayloadType {
3670 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3671}
3672impl Default for MavTunnelPayloadType {
3673 fn default() -> Self {
3674 Self::DEFAULT
3675 }
3676}
3677#[cfg_attr(feature = "ts", derive(TS))]
3678#[cfg_attr(feature = "ts", ts(export))]
3679#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3680#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3681#[cfg_attr(feature = "serde", serde(tag = "type"))]
3682#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3683#[repr(u32)]
3684#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3685pub enum MavType {
3686 #[doc = "Generic micro air vehicle"]
3687 MAV_TYPE_GENERIC = 0,
3688 #[doc = "Fixed wing aircraft."]
3689 MAV_TYPE_FIXED_WING = 1,
3690 #[doc = "Quadrotor"]
3691 MAV_TYPE_QUADROTOR = 2,
3692 #[doc = "Coaxial helicopter"]
3693 MAV_TYPE_COAXIAL = 3,
3694 #[doc = "Normal helicopter with tail rotor."]
3695 MAV_TYPE_HELICOPTER = 4,
3696 #[doc = "Ground installation"]
3697 MAV_TYPE_ANTENNA_TRACKER = 5,
3698 #[doc = "Operator control unit / ground control station"]
3699 MAV_TYPE_GCS = 6,
3700 #[doc = "Airship, controlled"]
3701 MAV_TYPE_AIRSHIP = 7,
3702 #[doc = "Free balloon, uncontrolled"]
3703 MAV_TYPE_FREE_BALLOON = 8,
3704 #[doc = "Rocket"]
3705 MAV_TYPE_ROCKET = 9,
3706 #[doc = "Ground rover"]
3707 MAV_TYPE_GROUND_ROVER = 10,
3708 #[doc = "Surface vessel, boat, ship"]
3709 MAV_TYPE_SURFACE_BOAT = 11,
3710 #[doc = "Submarine"]
3711 MAV_TYPE_SUBMARINE = 12,
3712 #[doc = "Hexarotor"]
3713 MAV_TYPE_HEXAROTOR = 13,
3714 #[doc = "Octorotor"]
3715 MAV_TYPE_OCTOROTOR = 14,
3716 #[doc = "Tricopter"]
3717 MAV_TYPE_TRICOPTER = 15,
3718 #[doc = "Flapping wing"]
3719 MAV_TYPE_FLAPPING_WING = 16,
3720 #[doc = "Kite"]
3721 MAV_TYPE_KITE = 17,
3722 #[doc = "Onboard companion controller"]
3723 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3724 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3725 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3726 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3727 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3728 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3729 MAV_TYPE_VTOL_TILTROTOR = 21,
3730 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3731 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3732 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3733 MAV_TYPE_VTOL_TAILSITTER = 23,
3734 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3735 MAV_TYPE_VTOL_TILTWING = 24,
3736 #[doc = "VTOL reserved 5"]
3737 MAV_TYPE_VTOL_RESERVED5 = 25,
3738 #[doc = "Gimbal"]
3739 MAV_TYPE_GIMBAL = 26,
3740 #[doc = "ADSB system"]
3741 MAV_TYPE_ADSB = 27,
3742 #[doc = "Steerable, nonrigid airfoil"]
3743 MAV_TYPE_PARAFOIL = 28,
3744 #[doc = "Dodecarotor"]
3745 MAV_TYPE_DODECAROTOR = 29,
3746 #[doc = "Camera"]
3747 MAV_TYPE_CAMERA = 30,
3748 #[doc = "Charging station"]
3749 MAV_TYPE_CHARGING_STATION = 31,
3750 #[doc = "FLARM collision avoidance system"]
3751 MAV_TYPE_FLARM = 32,
3752 #[doc = "Servo"]
3753 MAV_TYPE_SERVO = 33,
3754 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3755 MAV_TYPE_ODID = 34,
3756 #[doc = "Decarotor"]
3757 MAV_TYPE_DECAROTOR = 35,
3758 #[doc = "Battery"]
3759 MAV_TYPE_BATTERY = 36,
3760 #[doc = "Parachute"]
3761 MAV_TYPE_PARACHUTE = 37,
3762 #[doc = "Log"]
3763 MAV_TYPE_LOG = 38,
3764 #[doc = "OSD"]
3765 MAV_TYPE_OSD = 39,
3766 #[doc = "IMU"]
3767 MAV_TYPE_IMU = 40,
3768 #[doc = "GPS"]
3769 MAV_TYPE_GPS = 41,
3770 #[doc = "Winch"]
3771 MAV_TYPE_WINCH = 42,
3772 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3773 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3774 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3775 MAV_TYPE_ILLUMINATOR = 44,
3776 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3777 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3778}
3779impl MavType {
3780 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3781}
3782impl Default for MavType {
3783 fn default() -> Self {
3784 Self::DEFAULT
3785 }
3786}
3787#[cfg_attr(feature = "ts", derive(TS))]
3788#[cfg_attr(feature = "ts", ts(export))]
3789#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3790#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3791#[cfg_attr(feature = "serde", serde(tag = "type"))]
3792#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3793#[repr(u32)]
3794#[doc = "Enumeration of VTOL states"]
3795pub enum MavVtolState {
3796 #[doc = "MAV is not configured as VTOL"]
3797 MAV_VTOL_STATE_UNDEFINED = 0,
3798 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3799 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3800 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3801 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3802 #[doc = "VTOL is in multicopter state"]
3803 MAV_VTOL_STATE_MC = 3,
3804 #[doc = "VTOL is in fixed-wing state"]
3805 MAV_VTOL_STATE_FW = 4,
3806}
3807impl MavVtolState {
3808 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3809}
3810impl Default for MavVtolState {
3811 fn default() -> Self {
3812 Self::DEFAULT
3813 }
3814}
3815bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3816impl MavWinchStatusFlag {
3817 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3818}
3819impl Default for MavWinchStatusFlag {
3820 fn default() -> Self {
3821 Self::DEFAULT
3822 }
3823}
3824#[cfg_attr(feature = "ts", derive(TS))]
3825#[cfg_attr(feature = "ts", ts(export))]
3826#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3827#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3828#[cfg_attr(feature = "serde", serde(tag = "type"))]
3829#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3830#[repr(u32)]
3831pub enum MavlinkDataStreamType {
3832 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3833 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3834 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3835 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3836 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3837 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3838}
3839impl MavlinkDataStreamType {
3840 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3841}
3842impl Default for MavlinkDataStreamType {
3843 fn default() -> Self {
3844 Self::DEFAULT
3845 }
3846}
3847#[cfg_attr(feature = "ts", derive(TS))]
3848#[cfg_attr(feature = "ts", ts(export))]
3849#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3850#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3851#[cfg_attr(feature = "serde", serde(tag = "type"))]
3852#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3853#[repr(u32)]
3854#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3855pub enum MissionState {
3856 #[doc = "The mission status reporting is not supported."]
3857 MISSION_STATE_UNKNOWN = 0,
3858 #[doc = "No mission on the vehicle."]
3859 MISSION_STATE_NO_MISSION = 1,
3860 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3861 MISSION_STATE_NOT_STARTED = 2,
3862 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3863 MISSION_STATE_ACTIVE = 3,
3864 #[doc = "Mission is paused when in auto mode."]
3865 MISSION_STATE_PAUSED = 4,
3866 #[doc = "Mission has executed all mission items."]
3867 MISSION_STATE_COMPLETE = 5,
3868}
3869impl MissionState {
3870 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3871}
3872impl Default for MissionState {
3873 fn default() -> Self {
3874 Self::DEFAULT
3875 }
3876}
3877#[cfg_attr(feature = "ts", derive(TS))]
3878#[cfg_attr(feature = "ts", ts(export))]
3879#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3880#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3881#[cfg_attr(feature = "serde", serde(tag = "type"))]
3882#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3883#[repr(u32)]
3884#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3885pub enum MotorTestOrder {
3886 #[doc = "Default autopilot motor test method."]
3887 MOTOR_TEST_ORDER_DEFAULT = 0,
3888 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3889 MOTOR_TEST_ORDER_SEQUENCE = 1,
3890 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3891 MOTOR_TEST_ORDER_BOARD = 2,
3892}
3893impl MotorTestOrder {
3894 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3895}
3896impl Default for MotorTestOrder {
3897 fn default() -> Self {
3898 Self::DEFAULT
3899 }
3900}
3901#[cfg_attr(feature = "ts", derive(TS))]
3902#[cfg_attr(feature = "ts", ts(export))]
3903#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3904#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3905#[cfg_attr(feature = "serde", serde(tag = "type"))]
3906#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3907#[repr(u32)]
3908#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3909pub enum MotorTestThrottleType {
3910 #[doc = "Throttle as a percentage (0 ~ 100)"]
3911 MOTOR_TEST_THROTTLE_PERCENT = 0,
3912 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3913 MOTOR_TEST_THROTTLE_PWM = 1,
3914 #[doc = "Throttle pass-through from pilot's transmitter."]
3915 MOTOR_TEST_THROTTLE_PILOT = 2,
3916 #[doc = "Per-motor compass calibration test."]
3917 MOTOR_TEST_COMPASS_CAL = 3,
3918}
3919impl MotorTestThrottleType {
3920 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3921}
3922impl Default for MotorTestThrottleType {
3923 fn default() -> Self {
3924 Self::DEFAULT
3925 }
3926}
3927#[cfg_attr(feature = "ts", derive(TS))]
3928#[cfg_attr(feature = "ts", ts(export))]
3929#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3930#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3931#[cfg_attr(feature = "serde", serde(tag = "type"))]
3932#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3933#[repr(u32)]
3934pub enum NavVtolLandOptions {
3935 #[doc = "Default autopilot landing behaviour."]
3936 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3937 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3938 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3939 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3940 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3941}
3942impl NavVtolLandOptions {
3943 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3944}
3945impl Default for NavVtolLandOptions {
3946 fn default() -> Self {
3947 Self::DEFAULT
3948 }
3949}
3950#[cfg_attr(feature = "ts", derive(TS))]
3951#[cfg_attr(feature = "ts", ts(export))]
3952#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3953#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3954#[cfg_attr(feature = "serde", serde(tag = "type"))]
3955#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3956#[repr(u32)]
3957#[doc = "Yaw behaviour during orbit flight."]
3958pub enum OrbitYawBehaviour {
3959 #[doc = "Vehicle front points to the center (default)."]
3960 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3961 #[doc = "Vehicle front holds heading when message received."]
3962 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3963 #[doc = "Yaw uncontrolled."]
3964 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3965 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3966 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3967 #[doc = "Yaw controlled by RC input."]
3968 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3969 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3970 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3971}
3972impl OrbitYawBehaviour {
3973 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3974}
3975impl Default for OrbitYawBehaviour {
3976 fn default() -> Self {
3977 Self::DEFAULT
3978 }
3979}
3980#[cfg_attr(feature = "ts", derive(TS))]
3981#[cfg_attr(feature = "ts", ts(export))]
3982#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3983#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3984#[cfg_attr(feature = "serde", serde(tag = "type"))]
3985#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3986#[repr(u32)]
3987#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
3988pub enum ParachuteAction {
3989 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
3990 PARACHUTE_DISABLE = 0,
3991 #[doc = "Enable auto-release of parachute."]
3992 PARACHUTE_ENABLE = 1,
3993 #[doc = "Release parachute and kill motors."]
3994 PARACHUTE_RELEASE = 2,
3995}
3996impl ParachuteAction {
3997 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
3998}
3999impl Default for ParachuteAction {
4000 fn default() -> Self {
4001 Self::DEFAULT
4002 }
4003}
4004#[cfg_attr(feature = "ts", derive(TS))]
4005#[cfg_attr(feature = "ts", ts(export))]
4006#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4007#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4008#[cfg_attr(feature = "serde", serde(tag = "type"))]
4009#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4010#[repr(u32)]
4011#[doc = "Result from PARAM_EXT_SET message."]
4012pub enum ParamAck {
4013 #[doc = "Parameter value ACCEPTED and SET"]
4014 PARAM_ACK_ACCEPTED = 0,
4015 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
4016 PARAM_ACK_VALUE_UNSUPPORTED = 1,
4017 #[doc = "Parameter failed to set"]
4018 PARAM_ACK_FAILED = 2,
4019 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
4020 PARAM_ACK_IN_PROGRESS = 3,
4021}
4022impl ParamAck {
4023 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
4024}
4025impl Default for ParamAck {
4026 fn default() -> Self {
4027 Self::DEFAULT
4028 }
4029}
4030bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
4031impl PositionTargetTypemask {
4032 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
4033}
4034impl Default for PositionTargetTypemask {
4035 fn default() -> Self {
4036 Self::DEFAULT
4037 }
4038}
4039#[cfg_attr(feature = "ts", derive(TS))]
4040#[cfg_attr(feature = "ts", ts(export))]
4041#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4042#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4043#[cfg_attr(feature = "serde", serde(tag = "type"))]
4044#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4045#[repr(u32)]
4046#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
4047pub enum PrecisionLandMode {
4048 #[doc = "Normal (non-precision) landing."]
4049 PRECISION_LAND_MODE_DISABLED = 0,
4050 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
4051 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
4052 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
4053 PRECISION_LAND_MODE_REQUIRED = 2,
4054}
4055impl PrecisionLandMode {
4056 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
4057}
4058impl Default for PrecisionLandMode {
4059 fn default() -> Self {
4060 Self::DEFAULT
4061 }
4062}
4063#[cfg_attr(feature = "ts", derive(TS))]
4064#[cfg_attr(feature = "ts", ts(export))]
4065#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4066#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4067#[cfg_attr(feature = "serde", serde(tag = "type"))]
4068#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4069#[repr(u32)]
4070#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4071pub enum PreflightStorageMissionAction {
4072 #[doc = "Read current mission data from persistent storage"]
4073 MISSION_READ_PERSISTENT = 0,
4074 #[doc = "Write current mission data to persistent storage"]
4075 MISSION_WRITE_PERSISTENT = 1,
4076 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
4077 MISSION_RESET_DEFAULT = 2,
4078}
4079impl PreflightStorageMissionAction {
4080 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
4081}
4082impl Default for PreflightStorageMissionAction {
4083 fn default() -> Self {
4084 Self::DEFAULT
4085 }
4086}
4087#[cfg_attr(feature = "ts", derive(TS))]
4088#[cfg_attr(feature = "ts", ts(export))]
4089#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4090#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4091#[cfg_attr(feature = "serde", serde(tag = "type"))]
4092#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4093#[repr(u32)]
4094#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4095pub enum PreflightStorageParameterAction {
4096 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
4097 PARAM_READ_PERSISTENT = 0,
4098 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
4099 PARAM_WRITE_PERSISTENT = 1,
4100 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
4101 PARAM_RESET_CONFIG_DEFAULT = 2,
4102 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
4103 PARAM_RESET_SENSOR_DEFAULT = 3,
4104 #[doc = "Reset all parameters, including operation counters, to default values"]
4105 PARAM_RESET_ALL_DEFAULT = 4,
4106}
4107impl PreflightStorageParameterAction {
4108 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
4109}
4110impl Default for PreflightStorageParameterAction {
4111 fn default() -> Self {
4112 Self::DEFAULT
4113 }
4114}
4115#[cfg_attr(feature = "ts", derive(TS))]
4116#[cfg_attr(feature = "ts", ts(export))]
4117#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4118#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4119#[cfg_attr(feature = "serde", serde(tag = "type"))]
4120#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4121#[repr(u32)]
4122#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
4123pub enum RcSubType {
4124 #[doc = "Spektrum DSM2"]
4125 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
4126 #[doc = "Spektrum DSMX"]
4127 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
4128 #[doc = "Spektrum DSMX8"]
4129 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
4130}
4131impl RcSubType {
4132 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
4133}
4134impl Default for RcSubType {
4135 fn default() -> Self {
4136 Self::DEFAULT
4137 }
4138}
4139#[cfg_attr(feature = "ts", derive(TS))]
4140#[cfg_attr(feature = "ts", ts(export))]
4141#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4142#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4143#[cfg_attr(feature = "serde", serde(tag = "type"))]
4144#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4145#[repr(u32)]
4146#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
4147pub enum RcType {
4148 #[doc = "Spektrum"]
4149 RC_TYPE_SPEKTRUM = 0,
4150 #[doc = "CRSF"]
4151 RC_TYPE_CRSF = 1,
4152}
4153impl RcType {
4154 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
4155}
4156impl Default for RcType {
4157 fn default() -> Self {
4158 Self::DEFAULT
4159 }
4160}
4161#[cfg_attr(feature = "ts", derive(TS))]
4162#[cfg_attr(feature = "ts", ts(export))]
4163#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4164#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4165#[cfg_attr(feature = "serde", serde(tag = "type"))]
4166#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4167#[repr(u32)]
4168#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
4169pub enum RebootShutdownConditions {
4170 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
4171 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
4172 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
4173 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
4174}
4175impl RebootShutdownConditions {
4176 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
4177}
4178impl Default for RebootShutdownConditions {
4179 fn default() -> Self {
4180 Self::DEFAULT
4181 }
4182}
4183#[cfg_attr(feature = "ts", derive(TS))]
4184#[cfg_attr(feature = "ts", ts(export))]
4185#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4186#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4187#[cfg_attr(feature = "serde", serde(tag = "type"))]
4188#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4189#[repr(u32)]
4190#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
4191pub enum RtkBaselineCoordinateSystem {
4192 #[doc = "Earth-centered, Earth-fixed"]
4193 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
4194 #[doc = "RTK basestation centered, north, east, down"]
4195 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
4196}
4197impl RtkBaselineCoordinateSystem {
4198 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
4199}
4200impl Default for RtkBaselineCoordinateSystem {
4201 fn default() -> Self {
4202 Self::DEFAULT
4203 }
4204}
4205#[cfg_attr(feature = "ts", derive(TS))]
4206#[cfg_attr(feature = "ts", ts(export))]
4207#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4208#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4209#[cfg_attr(feature = "serde", serde(tag = "type"))]
4210#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4211#[repr(u32)]
4212#[doc = "Possible safety switch states."]
4213pub enum SafetySwitchState {
4214 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
4215 SAFETY_SWITCH_STATE_SAFE = 0,
4216 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
4217 SAFETY_SWITCH_STATE_DANGEROUS = 1,
4218}
4219impl SafetySwitchState {
4220 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
4221}
4222impl Default for SafetySwitchState {
4223 fn default() -> Self {
4224 Self::DEFAULT
4225 }
4226}
4227#[cfg_attr(feature = "ts", derive(TS))]
4228#[cfg_attr(feature = "ts", ts(export))]
4229#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4230#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4231#[cfg_attr(feature = "serde", serde(tag = "type"))]
4232#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4233#[repr(u32)]
4234#[doc = "SERIAL_CONTROL device types"]
4235pub enum SerialControlDev {
4236 #[doc = "First telemetry port"]
4237 SERIAL_CONTROL_DEV_TELEM1 = 0,
4238 #[doc = "Second telemetry port"]
4239 SERIAL_CONTROL_DEV_TELEM2 = 1,
4240 #[doc = "First GPS port"]
4241 SERIAL_CONTROL_DEV_GPS1 = 2,
4242 #[doc = "Second GPS port"]
4243 SERIAL_CONTROL_DEV_GPS2 = 3,
4244 #[doc = "system shell"]
4245 SERIAL_CONTROL_DEV_SHELL = 10,
4246 #[doc = "SERIAL0"]
4247 SERIAL_CONTROL_SERIAL0 = 100,
4248 #[doc = "SERIAL1"]
4249 SERIAL_CONTROL_SERIAL1 = 101,
4250 #[doc = "SERIAL2"]
4251 SERIAL_CONTROL_SERIAL2 = 102,
4252 #[doc = "SERIAL3"]
4253 SERIAL_CONTROL_SERIAL3 = 103,
4254 #[doc = "SERIAL4"]
4255 SERIAL_CONTROL_SERIAL4 = 104,
4256 #[doc = "SERIAL5"]
4257 SERIAL_CONTROL_SERIAL5 = 105,
4258 #[doc = "SERIAL6"]
4259 SERIAL_CONTROL_SERIAL6 = 106,
4260 #[doc = "SERIAL7"]
4261 SERIAL_CONTROL_SERIAL7 = 107,
4262 #[doc = "SERIAL8"]
4263 SERIAL_CONTROL_SERIAL8 = 108,
4264 #[doc = "SERIAL9"]
4265 SERIAL_CONTROL_SERIAL9 = 109,
4266}
4267impl SerialControlDev {
4268 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4269}
4270impl Default for SerialControlDev {
4271 fn default() -> Self {
4272 Self::DEFAULT
4273 }
4274}
4275bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4276impl SerialControlFlag {
4277 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4278}
4279impl Default for SerialControlFlag {
4280 fn default() -> Self {
4281 Self::DEFAULT
4282 }
4283}
4284#[cfg_attr(feature = "ts", derive(TS))]
4285#[cfg_attr(feature = "ts", ts(export))]
4286#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4287#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4288#[cfg_attr(feature = "serde", serde(tag = "type"))]
4289#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4290#[repr(u32)]
4291#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4292pub enum SetFocusType {
4293 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4294 FOCUS_TYPE_STEP = 0,
4295 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4296 FOCUS_TYPE_CONTINUOUS = 1,
4297 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4298 FOCUS_TYPE_RANGE = 2,
4299 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4300 FOCUS_TYPE_METERS = 3,
4301 #[doc = "Focus automatically."]
4302 FOCUS_TYPE_AUTO = 4,
4303 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4304 FOCUS_TYPE_AUTO_SINGLE = 5,
4305 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4306 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4307}
4308impl SetFocusType {
4309 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4310}
4311impl Default for SetFocusType {
4312 fn default() -> Self {
4313 Self::DEFAULT
4314 }
4315}
4316#[cfg_attr(feature = "ts", derive(TS))]
4317#[cfg_attr(feature = "ts", ts(export))]
4318#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4319#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4320#[cfg_attr(feature = "serde", serde(tag = "type"))]
4321#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4322#[repr(u32)]
4323#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4324pub enum SpeedType {
4325 #[doc = "Airspeed"]
4326 SPEED_TYPE_AIRSPEED = 0,
4327 #[doc = "Groundspeed"]
4328 SPEED_TYPE_GROUNDSPEED = 1,
4329 #[doc = "Climb speed"]
4330 SPEED_TYPE_CLIMB_SPEED = 2,
4331 #[doc = "Descent speed"]
4332 SPEED_TYPE_DESCENT_SPEED = 3,
4333}
4334impl SpeedType {
4335 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4336}
4337impl Default for SpeedType {
4338 fn default() -> Self {
4339 Self::DEFAULT
4340 }
4341}
4342#[cfg_attr(feature = "ts", derive(TS))]
4343#[cfg_attr(feature = "ts", ts(export))]
4344#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4345#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4346#[cfg_attr(feature = "serde", serde(tag = "type"))]
4347#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4348#[repr(u32)]
4349#[doc = "Flags to indicate the status of camera storage."]
4350pub enum StorageStatus {
4351 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4352 STORAGE_STATUS_EMPTY = 0,
4353 #[doc = "Storage present but unformatted."]
4354 STORAGE_STATUS_UNFORMATTED = 1,
4355 #[doc = "Storage present and ready."]
4356 STORAGE_STATUS_READY = 2,
4357 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4358 STORAGE_STATUS_NOT_SUPPORTED = 3,
4359}
4360impl StorageStatus {
4361 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4362}
4363impl Default for StorageStatus {
4364 fn default() -> Self {
4365 Self::DEFAULT
4366 }
4367}
4368#[cfg_attr(feature = "ts", derive(TS))]
4369#[cfg_attr(feature = "ts", ts(export))]
4370#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4371#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4372#[cfg_attr(feature = "serde", serde(tag = "type"))]
4373#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4374#[repr(u32)]
4375#[doc = "Flags to indicate the type of storage."]
4376pub enum StorageType {
4377 #[doc = "Storage type is not known."]
4378 STORAGE_TYPE_UNKNOWN = 0,
4379 #[doc = "Storage type is USB device."]
4380 STORAGE_TYPE_USB_STICK = 1,
4381 #[doc = "Storage type is SD card."]
4382 STORAGE_TYPE_SD = 2,
4383 #[doc = "Storage type is microSD card."]
4384 STORAGE_TYPE_MICROSD = 3,
4385 #[doc = "Storage type is CFast."]
4386 STORAGE_TYPE_CF = 4,
4387 #[doc = "Storage type is CFexpress."]
4388 STORAGE_TYPE_CFE = 5,
4389 #[doc = "Storage type is XQD."]
4390 STORAGE_TYPE_XQD = 6,
4391 #[doc = "Storage type is HD mass storage type."]
4392 STORAGE_TYPE_HD = 7,
4393 #[doc = "Storage type is other, not listed type."]
4394 STORAGE_TYPE_OTHER = 254,
4395}
4396impl StorageType {
4397 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4398}
4399impl Default for StorageType {
4400 fn default() -> Self {
4401 Self::DEFAULT
4402 }
4403}
4404bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4405impl StorageUsageFlag {
4406 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4407}
4408impl Default for StorageUsageFlag {
4409 fn default() -> Self {
4410 Self::DEFAULT
4411 }
4412}
4413#[cfg_attr(feature = "ts", derive(TS))]
4414#[cfg_attr(feature = "ts", ts(export))]
4415#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4416#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4417#[cfg_attr(feature = "serde", serde(tag = "type"))]
4418#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4419#[repr(u32)]
4420#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4421pub enum TuneFormat {
4422 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4423 TUNE_FORMAT_QBASIC1_1 = 1,
4424 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4425 TUNE_FORMAT_MML_MODERN = 2,
4426}
4427impl TuneFormat {
4428 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4429}
4430impl Default for TuneFormat {
4431 fn default() -> Self {
4432 Self::DEFAULT
4433 }
4434}
4435#[cfg_attr(feature = "ts", derive(TS))]
4436#[cfg_attr(feature = "ts", ts(export))]
4437#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4438#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4439#[cfg_attr(feature = "serde", serde(tag = "type"))]
4440#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4441#[repr(u32)]
4442#[doc = "Generalized UAVCAN node health"]
4443pub enum UavcanNodeHealth {
4444 #[doc = "The node is functioning properly."]
4445 UAVCAN_NODE_HEALTH_OK = 0,
4446 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4447 UAVCAN_NODE_HEALTH_WARNING = 1,
4448 #[doc = "The node has encountered a major failure."]
4449 UAVCAN_NODE_HEALTH_ERROR = 2,
4450 #[doc = "The node has suffered a fatal malfunction."]
4451 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4452}
4453impl UavcanNodeHealth {
4454 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4455}
4456impl Default for UavcanNodeHealth {
4457 fn default() -> Self {
4458 Self::DEFAULT
4459 }
4460}
4461#[cfg_attr(feature = "ts", derive(TS))]
4462#[cfg_attr(feature = "ts", ts(export))]
4463#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4464#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4465#[cfg_attr(feature = "serde", serde(tag = "type"))]
4466#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4467#[repr(u32)]
4468#[doc = "Generalized UAVCAN node mode"]
4469pub enum UavcanNodeMode {
4470 #[doc = "The node is performing its primary functions."]
4471 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4472 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4473 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4474 #[doc = "The node is under maintenance."]
4475 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4476 #[doc = "The node is in the process of updating its software."]
4477 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4478 #[doc = "The node is no longer available online."]
4479 UAVCAN_NODE_MODE_OFFLINE = 7,
4480}
4481impl UavcanNodeMode {
4482 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4483}
4484impl Default for UavcanNodeMode {
4485 fn default() -> Self {
4486 Self::DEFAULT
4487 }
4488}
4489bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4490impl UtmDataAvailFlags {
4491 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4492}
4493impl Default for UtmDataAvailFlags {
4494 fn default() -> Self {
4495 Self::DEFAULT
4496 }
4497}
4498#[cfg_attr(feature = "ts", derive(TS))]
4499#[cfg_attr(feature = "ts", ts(export))]
4500#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4501#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4502#[cfg_attr(feature = "serde", serde(tag = "type"))]
4503#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4504#[repr(u32)]
4505#[doc = "Airborne status of UAS."]
4506pub enum UtmFlightState {
4507 #[doc = "The flight state can't be determined."]
4508 UTM_FLIGHT_STATE_UNKNOWN = 1,
4509 #[doc = "UAS on ground."]
4510 UTM_FLIGHT_STATE_GROUND = 2,
4511 #[doc = "UAS airborne."]
4512 UTM_FLIGHT_STATE_AIRBORNE = 3,
4513 #[doc = "UAS is in an emergency flight state."]
4514 UTM_FLIGHT_STATE_EMERGENCY = 16,
4515 #[doc = "UAS has no active controls."]
4516 UTM_FLIGHT_STATE_NOCTRL = 32,
4517}
4518impl UtmFlightState {
4519 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4520}
4521impl Default for UtmFlightState {
4522 fn default() -> Self {
4523 Self::DEFAULT
4524 }
4525}
4526#[cfg_attr(feature = "ts", derive(TS))]
4527#[cfg_attr(feature = "ts", ts(export))]
4528#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4529#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4530#[cfg_attr(feature = "serde", serde(tag = "type"))]
4531#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4532#[repr(u32)]
4533#[doc = "Video stream encodings"]
4534pub enum VideoStreamEncoding {
4535 #[doc = "Stream encoding is unknown"]
4536 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4537 #[doc = "Stream encoding is H.264"]
4538 VIDEO_STREAM_ENCODING_H264 = 1,
4539 #[doc = "Stream encoding is H.265"]
4540 VIDEO_STREAM_ENCODING_H265 = 2,
4541}
4542impl VideoStreamEncoding {
4543 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4544}
4545impl Default for VideoStreamEncoding {
4546 fn default() -> Self {
4547 Self::DEFAULT
4548 }
4549}
4550bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4551impl VideoStreamStatusFlags {
4552 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4553}
4554impl Default for VideoStreamStatusFlags {
4555 fn default() -> Self {
4556 Self::DEFAULT
4557 }
4558}
4559#[cfg_attr(feature = "ts", derive(TS))]
4560#[cfg_attr(feature = "ts", ts(export))]
4561#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4562#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4563#[cfg_attr(feature = "serde", serde(tag = "type"))]
4564#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4565#[repr(u32)]
4566#[doc = "Video stream types"]
4567pub enum VideoStreamType {
4568 #[doc = "Stream is RTSP"]
4569 VIDEO_STREAM_TYPE_RTSP = 0,
4570 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4571 VIDEO_STREAM_TYPE_RTPUDP = 1,
4572 #[doc = "Stream is MPEG on TCP"]
4573 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4574 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4575 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4576}
4577impl VideoStreamType {
4578 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4579}
4580impl Default for VideoStreamType {
4581 fn default() -> Self {
4582 Self::DEFAULT
4583 }
4584}
4585#[cfg_attr(feature = "ts", derive(TS))]
4586#[cfg_attr(feature = "ts", ts(export))]
4587#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4588#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4589#[cfg_attr(feature = "serde", serde(tag = "type"))]
4590#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4591#[repr(u32)]
4592#[doc = "Direction of VTOL transition"]
4593pub enum VtolTransitionHeading {
4594 #[doc = "Respect the heading configuration of the vehicle."]
4595 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4596 #[doc = "Use the heading pointing towards the next waypoint."]
4597 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4598 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4599 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4600 #[doc = "Use the specified heading in parameter 4."]
4601 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4602 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4603 VTOL_TRANSITION_HEADING_ANY = 4,
4604}
4605impl VtolTransitionHeading {
4606 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4607}
4608impl Default for VtolTransitionHeading {
4609 fn default() -> Self {
4610 Self::DEFAULT
4611 }
4612}
4613#[cfg_attr(feature = "ts", derive(TS))]
4614#[cfg_attr(feature = "ts", ts(export))]
4615#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4616#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4617#[cfg_attr(feature = "serde", serde(tag = "type"))]
4618#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4619#[repr(u32)]
4620#[doc = "WiFi Mode."]
4621pub enum WifiConfigApMode {
4622 #[doc = "WiFi mode is undefined."]
4623 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4624 #[doc = "WiFi configured as an access point."]
4625 WIFI_CONFIG_AP_MODE_AP = 1,
4626 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4627 WIFI_CONFIG_AP_MODE_STATION = 2,
4628 #[doc = "WiFi disabled."]
4629 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4630}
4631impl WifiConfigApMode {
4632 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4633}
4634impl Default for WifiConfigApMode {
4635 fn default() -> Self {
4636 Self::DEFAULT
4637 }
4638}
4639#[cfg_attr(feature = "ts", derive(TS))]
4640#[cfg_attr(feature = "ts", ts(export))]
4641#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4642#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4643#[cfg_attr(feature = "serde", serde(tag = "type"))]
4644#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4645#[repr(u32)]
4646#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4647pub enum WifiConfigApResponse {
4648 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4649 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4650 #[doc = "Changes accepted."]
4651 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4652 #[doc = "Changes rejected."]
4653 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4654 #[doc = "Invalid Mode."]
4655 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4656 #[doc = "Invalid SSID."]
4657 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4658 #[doc = "Invalid Password."]
4659 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4660}
4661impl WifiConfigApResponse {
4662 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4663}
4664impl Default for WifiConfigApResponse {
4665 fn default() -> Self {
4666 Self::DEFAULT
4667 }
4668}
4669#[cfg_attr(feature = "ts", derive(TS))]
4670#[cfg_attr(feature = "ts", ts(export))]
4671#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4672#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4673#[cfg_attr(feature = "serde", serde(tag = "type"))]
4674#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4675#[repr(u32)]
4676#[doc = "Winch actions."]
4677pub enum WinchActions {
4678 #[doc = "Allow motor to freewheel."]
4679 WINCH_RELAXED = 0,
4680 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4681 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4682 #[doc = "Wind or unwind line at specified rate."]
4683 WINCH_RATE_CONTROL = 2,
4684 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4685 WINCH_LOCK = 3,
4686 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4687 WINCH_DELIVER = 4,
4688 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4689 WINCH_HOLD = 5,
4690 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4691 WINCH_RETRACT = 6,
4692 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4693 WINCH_LOAD_LINE = 7,
4694 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4695 WINCH_ABANDON_LINE = 8,
4696 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4697 WINCH_LOAD_PAYLOAD = 9,
4698}
4699impl WinchActions {
4700 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4701}
4702impl Default for WinchActions {
4703 fn default() -> Self {
4704 Self::DEFAULT
4705 }
4706}
4707#[doc = "Set the vehicle attitude and body angular rates."]
4708#[doc = ""]
4709#[doc = "ID: 140"]
4710#[derive(Debug, Clone, PartialEq)]
4711#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4712#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4713#[cfg_attr(feature = "ts", derive(TS))]
4714#[cfg_attr(feature = "ts", ts(export))]
4715pub struct ACTUATOR_CONTROL_TARGET_DATA {
4716 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4717 pub time_usec: u64,
4718 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4719 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4720 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4721 pub controls: [f32; 8],
4722 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4723 pub group_mlx: u8,
4724}
4725impl ACTUATOR_CONTROL_TARGET_DATA {
4726 pub const ENCODED_LEN: usize = 41usize;
4727 pub const DEFAULT: Self = Self {
4728 time_usec: 0_u64,
4729 controls: [0.0_f32; 8usize],
4730 group_mlx: 0_u8,
4731 };
4732 #[cfg(feature = "arbitrary")]
4733 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4734 use arbitrary::{Arbitrary, Unstructured};
4735 let mut buf = [0u8; 1024];
4736 rng.fill_bytes(&mut buf);
4737 let mut unstructured = Unstructured::new(&buf);
4738 Self::arbitrary(&mut unstructured).unwrap_or_default()
4739 }
4740}
4741impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4742 fn default() -> Self {
4743 Self::DEFAULT.clone()
4744 }
4745}
4746impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4747 type Message = MavMessage;
4748 const ID: u32 = 140u32;
4749 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4750 const EXTRA_CRC: u8 = 181u8;
4751 const ENCODED_LEN: usize = 41usize;
4752 fn deser(
4753 _version: MavlinkVersion,
4754 __input: &[u8],
4755 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4756 let avail_len = __input.len();
4757 let mut payload_buf = [0; Self::ENCODED_LEN];
4758 let mut buf = if avail_len < Self::ENCODED_LEN {
4759 payload_buf[0..avail_len].copy_from_slice(__input);
4760 Bytes::new(&payload_buf)
4761 } else {
4762 Bytes::new(__input)
4763 };
4764 let mut __struct = Self::default();
4765 __struct.time_usec = buf.get_u64_le()?;
4766 for v in &mut __struct.controls {
4767 let val = buf.get_f32_le()?;
4768 *v = val;
4769 }
4770 __struct.group_mlx = buf.get_u8()?;
4771 Ok(__struct)
4772 }
4773 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4774 let mut __tmp = BytesMut::new(bytes);
4775 #[allow(clippy::absurd_extreme_comparisons)]
4776 #[allow(unused_comparisons)]
4777 if __tmp.remaining() < Self::ENCODED_LEN {
4778 panic!(
4779 "buffer is too small (need {} bytes, but got {})",
4780 Self::ENCODED_LEN,
4781 __tmp.remaining(),
4782 )
4783 }
4784 __tmp.put_u64_le(self.time_usec);
4785 for val in &self.controls {
4786 __tmp.put_f32_le(*val);
4787 }
4788 __tmp.put_u8(self.group_mlx);
4789 if matches!(version, MavlinkVersion::V2) {
4790 let len = __tmp.len();
4791 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4792 } else {
4793 __tmp.len()
4794 }
4795 }
4796}
4797#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4798#[doc = ""]
4799#[doc = "ID: 375"]
4800#[derive(Debug, Clone, PartialEq)]
4801#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4802#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4803#[cfg_attr(feature = "ts", derive(TS))]
4804#[cfg_attr(feature = "ts", ts(export))]
4805pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4806 #[doc = "Timestamp (since system boot)."]
4807 pub time_usec: u64,
4808 #[doc = "Active outputs"]
4809 pub active: u32,
4810 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4811 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4812 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4813 pub actuator: [f32; 32],
4814}
4815impl ACTUATOR_OUTPUT_STATUS_DATA {
4816 pub const ENCODED_LEN: usize = 140usize;
4817 pub const DEFAULT: Self = Self {
4818 time_usec: 0_u64,
4819 active: 0_u32,
4820 actuator: [0.0_f32; 32usize],
4821 };
4822 #[cfg(feature = "arbitrary")]
4823 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4824 use arbitrary::{Arbitrary, Unstructured};
4825 let mut buf = [0u8; 1024];
4826 rng.fill_bytes(&mut buf);
4827 let mut unstructured = Unstructured::new(&buf);
4828 Self::arbitrary(&mut unstructured).unwrap_or_default()
4829 }
4830}
4831impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4832 fn default() -> Self {
4833 Self::DEFAULT.clone()
4834 }
4835}
4836impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4837 type Message = MavMessage;
4838 const ID: u32 = 375u32;
4839 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4840 const EXTRA_CRC: u8 = 251u8;
4841 const ENCODED_LEN: usize = 140usize;
4842 fn deser(
4843 _version: MavlinkVersion,
4844 __input: &[u8],
4845 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4846 let avail_len = __input.len();
4847 let mut payload_buf = [0; Self::ENCODED_LEN];
4848 let mut buf = if avail_len < Self::ENCODED_LEN {
4849 payload_buf[0..avail_len].copy_from_slice(__input);
4850 Bytes::new(&payload_buf)
4851 } else {
4852 Bytes::new(__input)
4853 };
4854 let mut __struct = Self::default();
4855 __struct.time_usec = buf.get_u64_le()?;
4856 __struct.active = buf.get_u32_le()?;
4857 for v in &mut __struct.actuator {
4858 let val = buf.get_f32_le()?;
4859 *v = val;
4860 }
4861 Ok(__struct)
4862 }
4863 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4864 let mut __tmp = BytesMut::new(bytes);
4865 #[allow(clippy::absurd_extreme_comparisons)]
4866 #[allow(unused_comparisons)]
4867 if __tmp.remaining() < Self::ENCODED_LEN {
4868 panic!(
4869 "buffer is too small (need {} bytes, but got {})",
4870 Self::ENCODED_LEN,
4871 __tmp.remaining(),
4872 )
4873 }
4874 __tmp.put_u64_le(self.time_usec);
4875 __tmp.put_u32_le(self.active);
4876 for val in &self.actuator {
4877 __tmp.put_f32_le(*val);
4878 }
4879 if matches!(version, MavlinkVersion::V2) {
4880 let len = __tmp.len();
4881 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4882 } else {
4883 __tmp.len()
4884 }
4885 }
4886}
4887#[doc = "The location and information of an ADSB vehicle."]
4888#[doc = ""]
4889#[doc = "ID: 246"]
4890#[derive(Debug, Clone, PartialEq)]
4891#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4892#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4893#[cfg_attr(feature = "ts", derive(TS))]
4894#[cfg_attr(feature = "ts", ts(export))]
4895pub struct ADSB_VEHICLE_DATA {
4896 #[doc = "ICAO address"]
4897 pub ICAO_address: u32,
4898 #[doc = "Latitude"]
4899 pub lat: i32,
4900 #[doc = "Longitude"]
4901 pub lon: i32,
4902 #[doc = "Altitude(ASL)"]
4903 pub altitude: i32,
4904 #[doc = "Course over ground"]
4905 pub heading: u16,
4906 #[doc = "The horizontal velocity"]
4907 pub hor_velocity: u16,
4908 #[doc = "The vertical velocity. Positive is up"]
4909 pub ver_velocity: i16,
4910 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4911 pub flags: AdsbFlags,
4912 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4913 pub squawk: u16,
4914 #[doc = "ADSB altitude type."]
4915 pub altitude_type: AdsbAltitudeType,
4916 #[doc = "The callsign, 8+null"]
4917 #[cfg_attr(feature = "ts", ts(type = "string"))]
4918 pub callsign: CharArray<9>,
4919 #[doc = "ADSB emitter type."]
4920 pub emitter_type: AdsbEmitterType,
4921 #[doc = "Time since last communication in seconds"]
4922 pub tslc: u8,
4923}
4924impl ADSB_VEHICLE_DATA {
4925 pub const ENCODED_LEN: usize = 38usize;
4926 pub const DEFAULT: Self = Self {
4927 ICAO_address: 0_u32,
4928 lat: 0_i32,
4929 lon: 0_i32,
4930 altitude: 0_i32,
4931 heading: 0_u16,
4932 hor_velocity: 0_u16,
4933 ver_velocity: 0_i16,
4934 flags: AdsbFlags::DEFAULT,
4935 squawk: 0_u16,
4936 altitude_type: AdsbAltitudeType::DEFAULT,
4937 callsign: CharArray::new([0_u8; 9usize]),
4938 emitter_type: AdsbEmitterType::DEFAULT,
4939 tslc: 0_u8,
4940 };
4941 #[cfg(feature = "arbitrary")]
4942 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4943 use arbitrary::{Arbitrary, Unstructured};
4944 let mut buf = [0u8; 1024];
4945 rng.fill_bytes(&mut buf);
4946 let mut unstructured = Unstructured::new(&buf);
4947 Self::arbitrary(&mut unstructured).unwrap_or_default()
4948 }
4949}
4950impl Default for ADSB_VEHICLE_DATA {
4951 fn default() -> Self {
4952 Self::DEFAULT.clone()
4953 }
4954}
4955impl MessageData for ADSB_VEHICLE_DATA {
4956 type Message = MavMessage;
4957 const ID: u32 = 246u32;
4958 const NAME: &'static str = "ADSB_VEHICLE";
4959 const EXTRA_CRC: u8 = 184u8;
4960 const ENCODED_LEN: usize = 38usize;
4961 fn deser(
4962 _version: MavlinkVersion,
4963 __input: &[u8],
4964 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4965 let avail_len = __input.len();
4966 let mut payload_buf = [0; Self::ENCODED_LEN];
4967 let mut buf = if avail_len < Self::ENCODED_LEN {
4968 payload_buf[0..avail_len].copy_from_slice(__input);
4969 Bytes::new(&payload_buf)
4970 } else {
4971 Bytes::new(__input)
4972 };
4973 let mut __struct = Self::default();
4974 __struct.ICAO_address = buf.get_u32_le()?;
4975 __struct.lat = buf.get_i32_le()?;
4976 __struct.lon = buf.get_i32_le()?;
4977 __struct.altitude = buf.get_i32_le()?;
4978 __struct.heading = buf.get_u16_le()?;
4979 __struct.hor_velocity = buf.get_u16_le()?;
4980 __struct.ver_velocity = buf.get_i16_le()?;
4981 let tmp = buf.get_u16_le()?;
4982 __struct.flags = AdsbFlags::from_bits(tmp as <AdsbFlags as Flags>::Bits).ok_or(
4983 ::mavlink_core::error::ParserError::InvalidFlag {
4984 flag_type: "AdsbFlags",
4985 value: tmp as u64,
4986 },
4987 )?;
4988 __struct.squawk = buf.get_u16_le()?;
4989 let tmp = buf.get_u8()?;
4990 __struct.altitude_type =
4991 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4992 enum_type: "AdsbAltitudeType",
4993 value: tmp as u64,
4994 })?;
4995 let mut tmp = [0_u8; 9usize];
4996 for v in &mut tmp {
4997 *v = buf.get_u8()?;
4998 }
4999 __struct.callsign = CharArray::new(tmp);
5000 let tmp = buf.get_u8()?;
5001 __struct.emitter_type =
5002 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5003 enum_type: "AdsbEmitterType",
5004 value: tmp as u64,
5005 })?;
5006 __struct.tslc = buf.get_u8()?;
5007 Ok(__struct)
5008 }
5009 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5010 let mut __tmp = BytesMut::new(bytes);
5011 #[allow(clippy::absurd_extreme_comparisons)]
5012 #[allow(unused_comparisons)]
5013 if __tmp.remaining() < Self::ENCODED_LEN {
5014 panic!(
5015 "buffer is too small (need {} bytes, but got {})",
5016 Self::ENCODED_LEN,
5017 __tmp.remaining(),
5018 )
5019 }
5020 __tmp.put_u32_le(self.ICAO_address);
5021 __tmp.put_i32_le(self.lat);
5022 __tmp.put_i32_le(self.lon);
5023 __tmp.put_i32_le(self.altitude);
5024 __tmp.put_u16_le(self.heading);
5025 __tmp.put_u16_le(self.hor_velocity);
5026 __tmp.put_i16_le(self.ver_velocity);
5027 __tmp.put_u16_le(self.flags.bits() as u16);
5028 __tmp.put_u16_le(self.squawk);
5029 __tmp.put_u8(self.altitude_type as u8);
5030 for val in &self.callsign {
5031 __tmp.put_u8(*val);
5032 }
5033 __tmp.put_u8(self.emitter_type as u8);
5034 __tmp.put_u8(self.tslc);
5035 if matches!(version, MavlinkVersion::V2) {
5036 let len = __tmp.len();
5037 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5038 } else {
5039 __tmp.len()
5040 }
5041 }
5042}
5043#[doc = "The airspeed measured by sensors and IMU."]
5044#[doc = ""]
5045#[doc = "ID: 182"]
5046#[derive(Debug, Clone, PartialEq)]
5047#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5048#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5049#[cfg_attr(feature = "ts", derive(TS))]
5050#[cfg_attr(feature = "ts", ts(export))]
5051pub struct AIRSPEEDS_DATA {
5052 #[doc = "Timestamp (milliseconds since system boot)"]
5053 pub time_boot_ms: u32,
5054 #[doc = "Airspeed estimate from IMU, cm/s"]
5055 pub airspeed_imu: i16,
5056 #[doc = "Pitot measured forward airpseed, cm/s"]
5057 pub airspeed_pitot: i16,
5058 #[doc = "Hot wire anenometer measured airspeed, cm/s"]
5059 pub airspeed_hot_wire: i16,
5060 #[doc = "Ultrasonic measured airspeed, cm/s"]
5061 pub airspeed_ultrasonic: i16,
5062 #[doc = "Angle of attack sensor, degrees * 10"]
5063 pub aoa: i16,
5064 #[doc = "Yaw angle sensor, degrees * 10"]
5065 pub aoy: i16,
5066}
5067impl AIRSPEEDS_DATA {
5068 pub const ENCODED_LEN: usize = 16usize;
5069 pub const DEFAULT: Self = Self {
5070 time_boot_ms: 0_u32,
5071 airspeed_imu: 0_i16,
5072 airspeed_pitot: 0_i16,
5073 airspeed_hot_wire: 0_i16,
5074 airspeed_ultrasonic: 0_i16,
5075 aoa: 0_i16,
5076 aoy: 0_i16,
5077 };
5078 #[cfg(feature = "arbitrary")]
5079 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5080 use arbitrary::{Arbitrary, Unstructured};
5081 let mut buf = [0u8; 1024];
5082 rng.fill_bytes(&mut buf);
5083 let mut unstructured = Unstructured::new(&buf);
5084 Self::arbitrary(&mut unstructured).unwrap_or_default()
5085 }
5086}
5087impl Default for AIRSPEEDS_DATA {
5088 fn default() -> Self {
5089 Self::DEFAULT.clone()
5090 }
5091}
5092impl MessageData for AIRSPEEDS_DATA {
5093 type Message = MavMessage;
5094 const ID: u32 = 182u32;
5095 const NAME: &'static str = "AIRSPEEDS";
5096 const EXTRA_CRC: u8 = 154u8;
5097 const ENCODED_LEN: usize = 16usize;
5098 fn deser(
5099 _version: MavlinkVersion,
5100 __input: &[u8],
5101 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5102 let avail_len = __input.len();
5103 let mut payload_buf = [0; Self::ENCODED_LEN];
5104 let mut buf = if avail_len < Self::ENCODED_LEN {
5105 payload_buf[0..avail_len].copy_from_slice(__input);
5106 Bytes::new(&payload_buf)
5107 } else {
5108 Bytes::new(__input)
5109 };
5110 let mut __struct = Self::default();
5111 __struct.time_boot_ms = buf.get_u32_le()?;
5112 __struct.airspeed_imu = buf.get_i16_le()?;
5113 __struct.airspeed_pitot = buf.get_i16_le()?;
5114 __struct.airspeed_hot_wire = buf.get_i16_le()?;
5115 __struct.airspeed_ultrasonic = buf.get_i16_le()?;
5116 __struct.aoa = buf.get_i16_le()?;
5117 __struct.aoy = buf.get_i16_le()?;
5118 Ok(__struct)
5119 }
5120 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5121 let mut __tmp = BytesMut::new(bytes);
5122 #[allow(clippy::absurd_extreme_comparisons)]
5123 #[allow(unused_comparisons)]
5124 if __tmp.remaining() < Self::ENCODED_LEN {
5125 panic!(
5126 "buffer is too small (need {} bytes, but got {})",
5127 Self::ENCODED_LEN,
5128 __tmp.remaining(),
5129 )
5130 }
5131 __tmp.put_u32_le(self.time_boot_ms);
5132 __tmp.put_i16_le(self.airspeed_imu);
5133 __tmp.put_i16_le(self.airspeed_pitot);
5134 __tmp.put_i16_le(self.airspeed_hot_wire);
5135 __tmp.put_i16_le(self.airspeed_ultrasonic);
5136 __tmp.put_i16_le(self.aoa);
5137 __tmp.put_i16_le(self.aoy);
5138 if matches!(version, MavlinkVersion::V2) {
5139 let len = __tmp.len();
5140 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5141 } else {
5142 __tmp.len()
5143 }
5144 }
5145}
5146#[doc = "The location and information of an AIS vessel."]
5147#[doc = ""]
5148#[doc = "ID: 301"]
5149#[derive(Debug, Clone, PartialEq)]
5150#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5151#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5152#[cfg_attr(feature = "ts", derive(TS))]
5153#[cfg_attr(feature = "ts", ts(export))]
5154pub struct AIS_VESSEL_DATA {
5155 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
5156 pub MMSI: u32,
5157 #[doc = "Latitude"]
5158 pub lat: i32,
5159 #[doc = "Longitude"]
5160 pub lon: i32,
5161 #[doc = "Course over ground"]
5162 pub COG: u16,
5163 #[doc = "True heading"]
5164 pub heading: u16,
5165 #[doc = "Speed over ground"]
5166 pub velocity: u16,
5167 #[doc = "Distance from lat/lon location to bow"]
5168 pub dimension_bow: u16,
5169 #[doc = "Distance from lat/lon location to stern"]
5170 pub dimension_stern: u16,
5171 #[doc = "Time since last communication in seconds"]
5172 pub tslc: u16,
5173 #[doc = "Bitmask to indicate various statuses including valid data fields"]
5174 pub flags: AisFlags,
5175 #[doc = "Turn rate"]
5176 pub turn_rate: i8,
5177 #[doc = "Navigational status"]
5178 pub navigational_status: AisNavStatus,
5179 #[doc = "Type of vessels"]
5180 pub mavtype: AisType,
5181 #[doc = "Distance from lat/lon location to port side"]
5182 pub dimension_port: u8,
5183 #[doc = "Distance from lat/lon location to starboard side"]
5184 pub dimension_starboard: u8,
5185 #[doc = "The vessel callsign"]
5186 #[cfg_attr(feature = "ts", ts(type = "string"))]
5187 pub callsign: CharArray<7>,
5188 #[doc = "The vessel name"]
5189 #[cfg_attr(feature = "ts", ts(type = "string"))]
5190 pub name: CharArray<20>,
5191}
5192impl AIS_VESSEL_DATA {
5193 pub const ENCODED_LEN: usize = 58usize;
5194 pub const DEFAULT: Self = Self {
5195 MMSI: 0_u32,
5196 lat: 0_i32,
5197 lon: 0_i32,
5198 COG: 0_u16,
5199 heading: 0_u16,
5200 velocity: 0_u16,
5201 dimension_bow: 0_u16,
5202 dimension_stern: 0_u16,
5203 tslc: 0_u16,
5204 flags: AisFlags::DEFAULT,
5205 turn_rate: 0_i8,
5206 navigational_status: AisNavStatus::DEFAULT,
5207 mavtype: AisType::DEFAULT,
5208 dimension_port: 0_u8,
5209 dimension_starboard: 0_u8,
5210 callsign: CharArray::new([0_u8; 7usize]),
5211 name: CharArray::new([0_u8; 20usize]),
5212 };
5213 #[cfg(feature = "arbitrary")]
5214 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5215 use arbitrary::{Arbitrary, Unstructured};
5216 let mut buf = [0u8; 1024];
5217 rng.fill_bytes(&mut buf);
5218 let mut unstructured = Unstructured::new(&buf);
5219 Self::arbitrary(&mut unstructured).unwrap_or_default()
5220 }
5221}
5222impl Default for AIS_VESSEL_DATA {
5223 fn default() -> Self {
5224 Self::DEFAULT.clone()
5225 }
5226}
5227impl MessageData for AIS_VESSEL_DATA {
5228 type Message = MavMessage;
5229 const ID: u32 = 301u32;
5230 const NAME: &'static str = "AIS_VESSEL";
5231 const EXTRA_CRC: u8 = 243u8;
5232 const ENCODED_LEN: usize = 58usize;
5233 fn deser(
5234 _version: MavlinkVersion,
5235 __input: &[u8],
5236 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5237 let avail_len = __input.len();
5238 let mut payload_buf = [0; Self::ENCODED_LEN];
5239 let mut buf = if avail_len < Self::ENCODED_LEN {
5240 payload_buf[0..avail_len].copy_from_slice(__input);
5241 Bytes::new(&payload_buf)
5242 } else {
5243 Bytes::new(__input)
5244 };
5245 let mut __struct = Self::default();
5246 __struct.MMSI = buf.get_u32_le()?;
5247 __struct.lat = buf.get_i32_le()?;
5248 __struct.lon = buf.get_i32_le()?;
5249 __struct.COG = buf.get_u16_le()?;
5250 __struct.heading = buf.get_u16_le()?;
5251 __struct.velocity = buf.get_u16_le()?;
5252 __struct.dimension_bow = buf.get_u16_le()?;
5253 __struct.dimension_stern = buf.get_u16_le()?;
5254 __struct.tslc = buf.get_u16_le()?;
5255 let tmp = buf.get_u16_le()?;
5256 __struct.flags = AisFlags::from_bits(tmp as <AisFlags as Flags>::Bits).ok_or(
5257 ::mavlink_core::error::ParserError::InvalidFlag {
5258 flag_type: "AisFlags",
5259 value: tmp as u64,
5260 },
5261 )?;
5262 __struct.turn_rate = buf.get_i8()?;
5263 let tmp = buf.get_u8()?;
5264 __struct.navigational_status =
5265 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5266 enum_type: "AisNavStatus",
5267 value: tmp as u64,
5268 })?;
5269 let tmp = buf.get_u8()?;
5270 __struct.mavtype =
5271 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5272 enum_type: "AisType",
5273 value: tmp as u64,
5274 })?;
5275 __struct.dimension_port = buf.get_u8()?;
5276 __struct.dimension_starboard = buf.get_u8()?;
5277 let mut tmp = [0_u8; 7usize];
5278 for v in &mut tmp {
5279 *v = buf.get_u8()?;
5280 }
5281 __struct.callsign = CharArray::new(tmp);
5282 let mut tmp = [0_u8; 20usize];
5283 for v in &mut tmp {
5284 *v = buf.get_u8()?;
5285 }
5286 __struct.name = CharArray::new(tmp);
5287 Ok(__struct)
5288 }
5289 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5290 let mut __tmp = BytesMut::new(bytes);
5291 #[allow(clippy::absurd_extreme_comparisons)]
5292 #[allow(unused_comparisons)]
5293 if __tmp.remaining() < Self::ENCODED_LEN {
5294 panic!(
5295 "buffer is too small (need {} bytes, but got {})",
5296 Self::ENCODED_LEN,
5297 __tmp.remaining(),
5298 )
5299 }
5300 __tmp.put_u32_le(self.MMSI);
5301 __tmp.put_i32_le(self.lat);
5302 __tmp.put_i32_le(self.lon);
5303 __tmp.put_u16_le(self.COG);
5304 __tmp.put_u16_le(self.heading);
5305 __tmp.put_u16_le(self.velocity);
5306 __tmp.put_u16_le(self.dimension_bow);
5307 __tmp.put_u16_le(self.dimension_stern);
5308 __tmp.put_u16_le(self.tslc);
5309 __tmp.put_u16_le(self.flags.bits() as u16);
5310 __tmp.put_i8(self.turn_rate);
5311 __tmp.put_u8(self.navigational_status as u8);
5312 __tmp.put_u8(self.mavtype as u8);
5313 __tmp.put_u8(self.dimension_port);
5314 __tmp.put_u8(self.dimension_starboard);
5315 for val in &self.callsign {
5316 __tmp.put_u8(*val);
5317 }
5318 for val in &self.name {
5319 __tmp.put_u8(*val);
5320 }
5321 if matches!(version, MavlinkVersion::V2) {
5322 let len = __tmp.len();
5323 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5324 } else {
5325 __tmp.len()
5326 }
5327 }
5328}
5329#[doc = "The current system altitude."]
5330#[doc = ""]
5331#[doc = "ID: 141"]
5332#[derive(Debug, Clone, PartialEq)]
5333#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5334#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5335#[cfg_attr(feature = "ts", derive(TS))]
5336#[cfg_attr(feature = "ts", ts(export))]
5337pub struct ALTITUDE_DATA {
5338 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5339 pub time_usec: u64,
5340 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
5341 pub altitude_monotonic: f32,
5342 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
5343 pub altitude_amsl: f32,
5344 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
5345 pub altitude_local: f32,
5346 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
5347 pub altitude_relative: f32,
5348 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
5349 pub altitude_terrain: f32,
5350 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
5351 pub bottom_clearance: f32,
5352}
5353impl ALTITUDE_DATA {
5354 pub const ENCODED_LEN: usize = 32usize;
5355 pub const DEFAULT: Self = Self {
5356 time_usec: 0_u64,
5357 altitude_monotonic: 0.0_f32,
5358 altitude_amsl: 0.0_f32,
5359 altitude_local: 0.0_f32,
5360 altitude_relative: 0.0_f32,
5361 altitude_terrain: 0.0_f32,
5362 bottom_clearance: 0.0_f32,
5363 };
5364 #[cfg(feature = "arbitrary")]
5365 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5366 use arbitrary::{Arbitrary, Unstructured};
5367 let mut buf = [0u8; 1024];
5368 rng.fill_bytes(&mut buf);
5369 let mut unstructured = Unstructured::new(&buf);
5370 Self::arbitrary(&mut unstructured).unwrap_or_default()
5371 }
5372}
5373impl Default for ALTITUDE_DATA {
5374 fn default() -> Self {
5375 Self::DEFAULT.clone()
5376 }
5377}
5378impl MessageData for ALTITUDE_DATA {
5379 type Message = MavMessage;
5380 const ID: u32 = 141u32;
5381 const NAME: &'static str = "ALTITUDE";
5382 const EXTRA_CRC: u8 = 47u8;
5383 const ENCODED_LEN: usize = 32usize;
5384 fn deser(
5385 _version: MavlinkVersion,
5386 __input: &[u8],
5387 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5388 let avail_len = __input.len();
5389 let mut payload_buf = [0; Self::ENCODED_LEN];
5390 let mut buf = if avail_len < Self::ENCODED_LEN {
5391 payload_buf[0..avail_len].copy_from_slice(__input);
5392 Bytes::new(&payload_buf)
5393 } else {
5394 Bytes::new(__input)
5395 };
5396 let mut __struct = Self::default();
5397 __struct.time_usec = buf.get_u64_le()?;
5398 __struct.altitude_monotonic = buf.get_f32_le()?;
5399 __struct.altitude_amsl = buf.get_f32_le()?;
5400 __struct.altitude_local = buf.get_f32_le()?;
5401 __struct.altitude_relative = buf.get_f32_le()?;
5402 __struct.altitude_terrain = buf.get_f32_le()?;
5403 __struct.bottom_clearance = buf.get_f32_le()?;
5404 Ok(__struct)
5405 }
5406 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5407 let mut __tmp = BytesMut::new(bytes);
5408 #[allow(clippy::absurd_extreme_comparisons)]
5409 #[allow(unused_comparisons)]
5410 if __tmp.remaining() < Self::ENCODED_LEN {
5411 panic!(
5412 "buffer is too small (need {} bytes, but got {})",
5413 Self::ENCODED_LEN,
5414 __tmp.remaining(),
5415 )
5416 }
5417 __tmp.put_u64_le(self.time_usec);
5418 __tmp.put_f32_le(self.altitude_monotonic);
5419 __tmp.put_f32_le(self.altitude_amsl);
5420 __tmp.put_f32_le(self.altitude_local);
5421 __tmp.put_f32_le(self.altitude_relative);
5422 __tmp.put_f32_le(self.altitude_terrain);
5423 __tmp.put_f32_le(self.bottom_clearance);
5424 if matches!(version, MavlinkVersion::V2) {
5425 let len = __tmp.len();
5426 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5427 } else {
5428 __tmp.len()
5429 }
5430 }
5431}
5432#[doc = "The altitude measured by sensors and IMU."]
5433#[doc = ""]
5434#[doc = "ID: 181"]
5435#[derive(Debug, Clone, PartialEq)]
5436#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5437#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5438#[cfg_attr(feature = "ts", derive(TS))]
5439#[cfg_attr(feature = "ts", ts(export))]
5440pub struct ALTITUDES_DATA {
5441 #[doc = "Timestamp (milliseconds since system boot)"]
5442 pub time_boot_ms: u32,
5443 #[doc = "GPS altitude (MSL) in meters, expressed as * 1000 (millimeters)"]
5444 pub alt_gps: i32,
5445 #[doc = "IMU altitude above ground in meters, expressed as * 1000 (millimeters)"]
5446 pub alt_imu: i32,
5447 #[doc = "barometeric altitude above ground in meters, expressed as * 1000 (millimeters)"]
5448 pub alt_barometric: i32,
5449 #[doc = "Optical flow altitude above ground in meters, expressed as * 1000 (millimeters)"]
5450 pub alt_optical_flow: i32,
5451 #[doc = "Rangefinder Altitude above ground in meters, expressed as * 1000 (millimeters)"]
5452 pub alt_range_finder: i32,
5453 #[doc = "Extra altitude above ground in meters, expressed as * 1000 (millimeters)"]
5454 pub alt_extra: i32,
5455}
5456impl ALTITUDES_DATA {
5457 pub const ENCODED_LEN: usize = 28usize;
5458 pub const DEFAULT: Self = Self {
5459 time_boot_ms: 0_u32,
5460 alt_gps: 0_i32,
5461 alt_imu: 0_i32,
5462 alt_barometric: 0_i32,
5463 alt_optical_flow: 0_i32,
5464 alt_range_finder: 0_i32,
5465 alt_extra: 0_i32,
5466 };
5467 #[cfg(feature = "arbitrary")]
5468 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5469 use arbitrary::{Arbitrary, Unstructured};
5470 let mut buf = [0u8; 1024];
5471 rng.fill_bytes(&mut buf);
5472 let mut unstructured = Unstructured::new(&buf);
5473 Self::arbitrary(&mut unstructured).unwrap_or_default()
5474 }
5475}
5476impl Default for ALTITUDES_DATA {
5477 fn default() -> Self {
5478 Self::DEFAULT.clone()
5479 }
5480}
5481impl MessageData for ALTITUDES_DATA {
5482 type Message = MavMessage;
5483 const ID: u32 = 181u32;
5484 const NAME: &'static str = "ALTITUDES";
5485 const EXTRA_CRC: u8 = 55u8;
5486 const ENCODED_LEN: usize = 28usize;
5487 fn deser(
5488 _version: MavlinkVersion,
5489 __input: &[u8],
5490 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5491 let avail_len = __input.len();
5492 let mut payload_buf = [0; Self::ENCODED_LEN];
5493 let mut buf = if avail_len < Self::ENCODED_LEN {
5494 payload_buf[0..avail_len].copy_from_slice(__input);
5495 Bytes::new(&payload_buf)
5496 } else {
5497 Bytes::new(__input)
5498 };
5499 let mut __struct = Self::default();
5500 __struct.time_boot_ms = buf.get_u32_le()?;
5501 __struct.alt_gps = buf.get_i32_le()?;
5502 __struct.alt_imu = buf.get_i32_le()?;
5503 __struct.alt_barometric = buf.get_i32_le()?;
5504 __struct.alt_optical_flow = buf.get_i32_le()?;
5505 __struct.alt_range_finder = buf.get_i32_le()?;
5506 __struct.alt_extra = buf.get_i32_le()?;
5507 Ok(__struct)
5508 }
5509 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5510 let mut __tmp = BytesMut::new(bytes);
5511 #[allow(clippy::absurd_extreme_comparisons)]
5512 #[allow(unused_comparisons)]
5513 if __tmp.remaining() < Self::ENCODED_LEN {
5514 panic!(
5515 "buffer is too small (need {} bytes, but got {})",
5516 Self::ENCODED_LEN,
5517 __tmp.remaining(),
5518 )
5519 }
5520 __tmp.put_u32_le(self.time_boot_ms);
5521 __tmp.put_i32_le(self.alt_gps);
5522 __tmp.put_i32_le(self.alt_imu);
5523 __tmp.put_i32_le(self.alt_barometric);
5524 __tmp.put_i32_le(self.alt_optical_flow);
5525 __tmp.put_i32_le(self.alt_range_finder);
5526 __tmp.put_i32_le(self.alt_extra);
5527 if matches!(version, MavlinkVersion::V2) {
5528 let len = __tmp.len();
5529 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5530 } else {
5531 __tmp.len()
5532 }
5533 }
5534}
5535#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5536#[doc = ""]
5537#[doc = "ID: 30"]
5538#[derive(Debug, Clone, PartialEq)]
5539#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5540#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5541#[cfg_attr(feature = "ts", derive(TS))]
5542#[cfg_attr(feature = "ts", ts(export))]
5543pub struct ATTITUDE_DATA {
5544 #[doc = "Timestamp (time since system boot)."]
5545 pub time_boot_ms: u32,
5546 #[doc = "Roll angle (-pi..+pi)"]
5547 pub roll: f32,
5548 #[doc = "Pitch angle (-pi..+pi)"]
5549 pub pitch: f32,
5550 #[doc = "Yaw angle (-pi..+pi)"]
5551 pub yaw: f32,
5552 #[doc = "Roll angular speed"]
5553 pub rollspeed: f32,
5554 #[doc = "Pitch angular speed"]
5555 pub pitchspeed: f32,
5556 #[doc = "Yaw angular speed"]
5557 pub yawspeed: f32,
5558}
5559impl ATTITUDE_DATA {
5560 pub const ENCODED_LEN: usize = 28usize;
5561 pub const DEFAULT: Self = Self {
5562 time_boot_ms: 0_u32,
5563 roll: 0.0_f32,
5564 pitch: 0.0_f32,
5565 yaw: 0.0_f32,
5566 rollspeed: 0.0_f32,
5567 pitchspeed: 0.0_f32,
5568 yawspeed: 0.0_f32,
5569 };
5570 #[cfg(feature = "arbitrary")]
5571 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5572 use arbitrary::{Arbitrary, Unstructured};
5573 let mut buf = [0u8; 1024];
5574 rng.fill_bytes(&mut buf);
5575 let mut unstructured = Unstructured::new(&buf);
5576 Self::arbitrary(&mut unstructured).unwrap_or_default()
5577 }
5578}
5579impl Default for ATTITUDE_DATA {
5580 fn default() -> Self {
5581 Self::DEFAULT.clone()
5582 }
5583}
5584impl MessageData for ATTITUDE_DATA {
5585 type Message = MavMessage;
5586 const ID: u32 = 30u32;
5587 const NAME: &'static str = "ATTITUDE";
5588 const EXTRA_CRC: u8 = 39u8;
5589 const ENCODED_LEN: usize = 28usize;
5590 fn deser(
5591 _version: MavlinkVersion,
5592 __input: &[u8],
5593 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5594 let avail_len = __input.len();
5595 let mut payload_buf = [0; Self::ENCODED_LEN];
5596 let mut buf = if avail_len < Self::ENCODED_LEN {
5597 payload_buf[0..avail_len].copy_from_slice(__input);
5598 Bytes::new(&payload_buf)
5599 } else {
5600 Bytes::new(__input)
5601 };
5602 let mut __struct = Self::default();
5603 __struct.time_boot_ms = buf.get_u32_le()?;
5604 __struct.roll = buf.get_f32_le()?;
5605 __struct.pitch = buf.get_f32_le()?;
5606 __struct.yaw = buf.get_f32_le()?;
5607 __struct.rollspeed = buf.get_f32_le()?;
5608 __struct.pitchspeed = buf.get_f32_le()?;
5609 __struct.yawspeed = buf.get_f32_le()?;
5610 Ok(__struct)
5611 }
5612 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5613 let mut __tmp = BytesMut::new(bytes);
5614 #[allow(clippy::absurd_extreme_comparisons)]
5615 #[allow(unused_comparisons)]
5616 if __tmp.remaining() < Self::ENCODED_LEN {
5617 panic!(
5618 "buffer is too small (need {} bytes, but got {})",
5619 Self::ENCODED_LEN,
5620 __tmp.remaining(),
5621 )
5622 }
5623 __tmp.put_u32_le(self.time_boot_ms);
5624 __tmp.put_f32_le(self.roll);
5625 __tmp.put_f32_le(self.pitch);
5626 __tmp.put_f32_le(self.yaw);
5627 __tmp.put_f32_le(self.rollspeed);
5628 __tmp.put_f32_le(self.pitchspeed);
5629 __tmp.put_f32_le(self.yawspeed);
5630 if matches!(version, MavlinkVersion::V2) {
5631 let len = __tmp.len();
5632 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5633 } else {
5634 __tmp.len()
5635 }
5636 }
5637}
5638#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5639#[doc = ""]
5640#[doc = "ID: 31"]
5641#[derive(Debug, Clone, PartialEq)]
5642#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5643#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5644#[cfg_attr(feature = "ts", derive(TS))]
5645#[cfg_attr(feature = "ts", ts(export))]
5646pub struct ATTITUDE_QUATERNION_DATA {
5647 #[doc = "Timestamp (time since system boot)."]
5648 pub time_boot_ms: u32,
5649 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5650 pub q1: f32,
5651 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5652 pub q2: f32,
5653 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5654 pub q3: f32,
5655 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5656 pub q4: f32,
5657 #[doc = "Roll angular speed"]
5658 pub rollspeed: f32,
5659 #[doc = "Pitch angular speed"]
5660 pub pitchspeed: f32,
5661 #[doc = "Yaw angular speed"]
5662 pub yawspeed: f32,
5663 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5664 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5665 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5666 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5667 pub repr_offset_q: [f32; 4],
5668}
5669impl ATTITUDE_QUATERNION_DATA {
5670 pub const ENCODED_LEN: usize = 48usize;
5671 pub const DEFAULT: Self = Self {
5672 time_boot_ms: 0_u32,
5673 q1: 0.0_f32,
5674 q2: 0.0_f32,
5675 q3: 0.0_f32,
5676 q4: 0.0_f32,
5677 rollspeed: 0.0_f32,
5678 pitchspeed: 0.0_f32,
5679 yawspeed: 0.0_f32,
5680 repr_offset_q: [0.0_f32; 4usize],
5681 };
5682 #[cfg(feature = "arbitrary")]
5683 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5684 use arbitrary::{Arbitrary, Unstructured};
5685 let mut buf = [0u8; 1024];
5686 rng.fill_bytes(&mut buf);
5687 let mut unstructured = Unstructured::new(&buf);
5688 Self::arbitrary(&mut unstructured).unwrap_or_default()
5689 }
5690}
5691impl Default for ATTITUDE_QUATERNION_DATA {
5692 fn default() -> Self {
5693 Self::DEFAULT.clone()
5694 }
5695}
5696impl MessageData for ATTITUDE_QUATERNION_DATA {
5697 type Message = MavMessage;
5698 const ID: u32 = 31u32;
5699 const NAME: &'static str = "ATTITUDE_QUATERNION";
5700 const EXTRA_CRC: u8 = 246u8;
5701 const ENCODED_LEN: usize = 48usize;
5702 fn deser(
5703 _version: MavlinkVersion,
5704 __input: &[u8],
5705 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5706 let avail_len = __input.len();
5707 let mut payload_buf = [0; Self::ENCODED_LEN];
5708 let mut buf = if avail_len < Self::ENCODED_LEN {
5709 payload_buf[0..avail_len].copy_from_slice(__input);
5710 Bytes::new(&payload_buf)
5711 } else {
5712 Bytes::new(__input)
5713 };
5714 let mut __struct = Self::default();
5715 __struct.time_boot_ms = buf.get_u32_le()?;
5716 __struct.q1 = buf.get_f32_le()?;
5717 __struct.q2 = buf.get_f32_le()?;
5718 __struct.q3 = buf.get_f32_le()?;
5719 __struct.q4 = buf.get_f32_le()?;
5720 __struct.rollspeed = buf.get_f32_le()?;
5721 __struct.pitchspeed = buf.get_f32_le()?;
5722 __struct.yawspeed = buf.get_f32_le()?;
5723 for v in &mut __struct.repr_offset_q {
5724 let val = buf.get_f32_le()?;
5725 *v = val;
5726 }
5727 Ok(__struct)
5728 }
5729 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5730 let mut __tmp = BytesMut::new(bytes);
5731 #[allow(clippy::absurd_extreme_comparisons)]
5732 #[allow(unused_comparisons)]
5733 if __tmp.remaining() < Self::ENCODED_LEN {
5734 panic!(
5735 "buffer is too small (need {} bytes, but got {})",
5736 Self::ENCODED_LEN,
5737 __tmp.remaining(),
5738 )
5739 }
5740 __tmp.put_u32_le(self.time_boot_ms);
5741 __tmp.put_f32_le(self.q1);
5742 __tmp.put_f32_le(self.q2);
5743 __tmp.put_f32_le(self.q3);
5744 __tmp.put_f32_le(self.q4);
5745 __tmp.put_f32_le(self.rollspeed);
5746 __tmp.put_f32_le(self.pitchspeed);
5747 __tmp.put_f32_le(self.yawspeed);
5748 if matches!(version, MavlinkVersion::V2) {
5749 for val in &self.repr_offset_q {
5750 __tmp.put_f32_le(*val);
5751 }
5752 let len = __tmp.len();
5753 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5754 } else {
5755 __tmp.len()
5756 }
5757 }
5758}
5759#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5760#[doc = ""]
5761#[doc = "ID: 61"]
5762#[derive(Debug, Clone, PartialEq)]
5763#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5764#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5765#[cfg_attr(feature = "ts", derive(TS))]
5766#[cfg_attr(feature = "ts", ts(export))]
5767pub struct ATTITUDE_QUATERNION_COV_DATA {
5768 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5769 pub time_usec: u64,
5770 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5771 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5772 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5773 pub q: [f32; 4],
5774 #[doc = "Roll angular speed"]
5775 pub rollspeed: f32,
5776 #[doc = "Pitch angular speed"]
5777 pub pitchspeed: f32,
5778 #[doc = "Yaw angular speed"]
5779 pub yawspeed: f32,
5780 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5781 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5782 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5783 pub covariance: [f32; 9],
5784}
5785impl ATTITUDE_QUATERNION_COV_DATA {
5786 pub const ENCODED_LEN: usize = 72usize;
5787 pub const DEFAULT: Self = Self {
5788 time_usec: 0_u64,
5789 q: [0.0_f32; 4usize],
5790 rollspeed: 0.0_f32,
5791 pitchspeed: 0.0_f32,
5792 yawspeed: 0.0_f32,
5793 covariance: [0.0_f32; 9usize],
5794 };
5795 #[cfg(feature = "arbitrary")]
5796 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5797 use arbitrary::{Arbitrary, Unstructured};
5798 let mut buf = [0u8; 1024];
5799 rng.fill_bytes(&mut buf);
5800 let mut unstructured = Unstructured::new(&buf);
5801 Self::arbitrary(&mut unstructured).unwrap_or_default()
5802 }
5803}
5804impl Default for ATTITUDE_QUATERNION_COV_DATA {
5805 fn default() -> Self {
5806 Self::DEFAULT.clone()
5807 }
5808}
5809impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5810 type Message = MavMessage;
5811 const ID: u32 = 61u32;
5812 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5813 const EXTRA_CRC: u8 = 167u8;
5814 const ENCODED_LEN: usize = 72usize;
5815 fn deser(
5816 _version: MavlinkVersion,
5817 __input: &[u8],
5818 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5819 let avail_len = __input.len();
5820 let mut payload_buf = [0; Self::ENCODED_LEN];
5821 let mut buf = if avail_len < Self::ENCODED_LEN {
5822 payload_buf[0..avail_len].copy_from_slice(__input);
5823 Bytes::new(&payload_buf)
5824 } else {
5825 Bytes::new(__input)
5826 };
5827 let mut __struct = Self::default();
5828 __struct.time_usec = buf.get_u64_le()?;
5829 for v in &mut __struct.q {
5830 let val = buf.get_f32_le()?;
5831 *v = val;
5832 }
5833 __struct.rollspeed = buf.get_f32_le()?;
5834 __struct.pitchspeed = buf.get_f32_le()?;
5835 __struct.yawspeed = buf.get_f32_le()?;
5836 for v in &mut __struct.covariance {
5837 let val = buf.get_f32_le()?;
5838 *v = val;
5839 }
5840 Ok(__struct)
5841 }
5842 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5843 let mut __tmp = BytesMut::new(bytes);
5844 #[allow(clippy::absurd_extreme_comparisons)]
5845 #[allow(unused_comparisons)]
5846 if __tmp.remaining() < Self::ENCODED_LEN {
5847 panic!(
5848 "buffer is too small (need {} bytes, but got {})",
5849 Self::ENCODED_LEN,
5850 __tmp.remaining(),
5851 )
5852 }
5853 __tmp.put_u64_le(self.time_usec);
5854 for val in &self.q {
5855 __tmp.put_f32_le(*val);
5856 }
5857 __tmp.put_f32_le(self.rollspeed);
5858 __tmp.put_f32_le(self.pitchspeed);
5859 __tmp.put_f32_le(self.yawspeed);
5860 for val in &self.covariance {
5861 __tmp.put_f32_le(*val);
5862 }
5863 if matches!(version, MavlinkVersion::V2) {
5864 let len = __tmp.len();
5865 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5866 } else {
5867 __tmp.len()
5868 }
5869 }
5870}
5871#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
5872#[doc = ""]
5873#[doc = "ID: 83"]
5874#[derive(Debug, Clone, PartialEq)]
5875#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5876#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5877#[cfg_attr(feature = "ts", derive(TS))]
5878#[cfg_attr(feature = "ts", ts(export))]
5879pub struct ATTITUDE_TARGET_DATA {
5880 #[doc = "Timestamp (time since system boot)."]
5881 pub time_boot_ms: u32,
5882 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5883 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5884 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5885 pub q: [f32; 4],
5886 #[doc = "Body roll rate"]
5887 pub body_roll_rate: f32,
5888 #[doc = "Body pitch rate"]
5889 pub body_pitch_rate: f32,
5890 #[doc = "Body yaw rate"]
5891 pub body_yaw_rate: f32,
5892 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
5893 pub thrust: f32,
5894 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
5895 pub type_mask: AttitudeTargetTypemask,
5896}
5897impl ATTITUDE_TARGET_DATA {
5898 pub const ENCODED_LEN: usize = 37usize;
5899 pub const DEFAULT: Self = Self {
5900 time_boot_ms: 0_u32,
5901 q: [0.0_f32; 4usize],
5902 body_roll_rate: 0.0_f32,
5903 body_pitch_rate: 0.0_f32,
5904 body_yaw_rate: 0.0_f32,
5905 thrust: 0.0_f32,
5906 type_mask: AttitudeTargetTypemask::DEFAULT,
5907 };
5908 #[cfg(feature = "arbitrary")]
5909 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5910 use arbitrary::{Arbitrary, Unstructured};
5911 let mut buf = [0u8; 1024];
5912 rng.fill_bytes(&mut buf);
5913 let mut unstructured = Unstructured::new(&buf);
5914 Self::arbitrary(&mut unstructured).unwrap_or_default()
5915 }
5916}
5917impl Default for ATTITUDE_TARGET_DATA {
5918 fn default() -> Self {
5919 Self::DEFAULT.clone()
5920 }
5921}
5922impl MessageData for ATTITUDE_TARGET_DATA {
5923 type Message = MavMessage;
5924 const ID: u32 = 83u32;
5925 const NAME: &'static str = "ATTITUDE_TARGET";
5926 const EXTRA_CRC: u8 = 22u8;
5927 const ENCODED_LEN: usize = 37usize;
5928 fn deser(
5929 _version: MavlinkVersion,
5930 __input: &[u8],
5931 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5932 let avail_len = __input.len();
5933 let mut payload_buf = [0; Self::ENCODED_LEN];
5934 let mut buf = if avail_len < Self::ENCODED_LEN {
5935 payload_buf[0..avail_len].copy_from_slice(__input);
5936 Bytes::new(&payload_buf)
5937 } else {
5938 Bytes::new(__input)
5939 };
5940 let mut __struct = Self::default();
5941 __struct.time_boot_ms = buf.get_u32_le()?;
5942 for v in &mut __struct.q {
5943 let val = buf.get_f32_le()?;
5944 *v = val;
5945 }
5946 __struct.body_roll_rate = buf.get_f32_le()?;
5947 __struct.body_pitch_rate = buf.get_f32_le()?;
5948 __struct.body_yaw_rate = buf.get_f32_le()?;
5949 __struct.thrust = buf.get_f32_le()?;
5950 let tmp = buf.get_u8()?;
5951 __struct.type_mask =
5952 AttitudeTargetTypemask::from_bits(tmp as <AttitudeTargetTypemask as Flags>::Bits)
5953 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5954 flag_type: "AttitudeTargetTypemask",
5955 value: tmp as u64,
5956 })?;
5957 Ok(__struct)
5958 }
5959 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5960 let mut __tmp = BytesMut::new(bytes);
5961 #[allow(clippy::absurd_extreme_comparisons)]
5962 #[allow(unused_comparisons)]
5963 if __tmp.remaining() < Self::ENCODED_LEN {
5964 panic!(
5965 "buffer is too small (need {} bytes, but got {})",
5966 Self::ENCODED_LEN,
5967 __tmp.remaining(),
5968 )
5969 }
5970 __tmp.put_u32_le(self.time_boot_ms);
5971 for val in &self.q {
5972 __tmp.put_f32_le(*val);
5973 }
5974 __tmp.put_f32_le(self.body_roll_rate);
5975 __tmp.put_f32_le(self.body_pitch_rate);
5976 __tmp.put_f32_le(self.body_yaw_rate);
5977 __tmp.put_f32_le(self.thrust);
5978 __tmp.put_u8(self.type_mask.bits() as u8);
5979 if matches!(version, MavlinkVersion::V2) {
5980 let len = __tmp.len();
5981 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5982 } else {
5983 __tmp.len()
5984 }
5985 }
5986}
5987#[doc = "Motion capture attitude and position."]
5988#[doc = ""]
5989#[doc = "ID: 138"]
5990#[derive(Debug, Clone, PartialEq)]
5991#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5992#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5993#[cfg_attr(feature = "ts", derive(TS))]
5994#[cfg_attr(feature = "ts", ts(export))]
5995pub struct ATT_POS_MOCAP_DATA {
5996 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5997 pub time_usec: u64,
5998 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5999 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6000 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6001 pub q: [f32; 4],
6002 #[doc = "X position (NED)"]
6003 pub x: f32,
6004 #[doc = "Y position (NED)"]
6005 pub y: f32,
6006 #[doc = "Z position (NED)"]
6007 pub z: f32,
6008 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
6009 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6010 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6011 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6012 pub covariance: [f32; 21],
6013}
6014impl ATT_POS_MOCAP_DATA {
6015 pub const ENCODED_LEN: usize = 120usize;
6016 pub const DEFAULT: Self = Self {
6017 time_usec: 0_u64,
6018 q: [0.0_f32; 4usize],
6019 x: 0.0_f32,
6020 y: 0.0_f32,
6021 z: 0.0_f32,
6022 covariance: [0.0_f32; 21usize],
6023 };
6024 #[cfg(feature = "arbitrary")]
6025 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6026 use arbitrary::{Arbitrary, Unstructured};
6027 let mut buf = [0u8; 1024];
6028 rng.fill_bytes(&mut buf);
6029 let mut unstructured = Unstructured::new(&buf);
6030 Self::arbitrary(&mut unstructured).unwrap_or_default()
6031 }
6032}
6033impl Default for ATT_POS_MOCAP_DATA {
6034 fn default() -> Self {
6035 Self::DEFAULT.clone()
6036 }
6037}
6038impl MessageData for ATT_POS_MOCAP_DATA {
6039 type Message = MavMessage;
6040 const ID: u32 = 138u32;
6041 const NAME: &'static str = "ATT_POS_MOCAP";
6042 const EXTRA_CRC: u8 = 109u8;
6043 const ENCODED_LEN: usize = 120usize;
6044 fn deser(
6045 _version: MavlinkVersion,
6046 __input: &[u8],
6047 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6048 let avail_len = __input.len();
6049 let mut payload_buf = [0; Self::ENCODED_LEN];
6050 let mut buf = if avail_len < Self::ENCODED_LEN {
6051 payload_buf[0..avail_len].copy_from_slice(__input);
6052 Bytes::new(&payload_buf)
6053 } else {
6054 Bytes::new(__input)
6055 };
6056 let mut __struct = Self::default();
6057 __struct.time_usec = buf.get_u64_le()?;
6058 for v in &mut __struct.q {
6059 let val = buf.get_f32_le()?;
6060 *v = val;
6061 }
6062 __struct.x = buf.get_f32_le()?;
6063 __struct.y = buf.get_f32_le()?;
6064 __struct.z = buf.get_f32_le()?;
6065 for v in &mut __struct.covariance {
6066 let val = buf.get_f32_le()?;
6067 *v = val;
6068 }
6069 Ok(__struct)
6070 }
6071 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6072 let mut __tmp = BytesMut::new(bytes);
6073 #[allow(clippy::absurd_extreme_comparisons)]
6074 #[allow(unused_comparisons)]
6075 if __tmp.remaining() < Self::ENCODED_LEN {
6076 panic!(
6077 "buffer is too small (need {} bytes, but got {})",
6078 Self::ENCODED_LEN,
6079 __tmp.remaining(),
6080 )
6081 }
6082 __tmp.put_u64_le(self.time_usec);
6083 for val in &self.q {
6084 __tmp.put_f32_le(*val);
6085 }
6086 __tmp.put_f32_le(self.x);
6087 __tmp.put_f32_le(self.y);
6088 __tmp.put_f32_le(self.z);
6089 if matches!(version, MavlinkVersion::V2) {
6090 for val in &self.covariance {
6091 __tmp.put_f32_le(*val);
6092 }
6093 let len = __tmp.len();
6094 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6095 } else {
6096 __tmp.len()
6097 }
6098 }
6099}
6100#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
6101#[doc = ""]
6102#[doc = "ID: 7"]
6103#[derive(Debug, Clone, PartialEq)]
6104#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6105#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6106#[cfg_attr(feature = "ts", derive(TS))]
6107#[cfg_attr(feature = "ts", ts(export))]
6108pub struct AUTH_KEY_DATA {
6109 #[doc = "key"]
6110 #[cfg_attr(feature = "ts", ts(type = "string"))]
6111 pub key: CharArray<32>,
6112}
6113impl AUTH_KEY_DATA {
6114 pub const ENCODED_LEN: usize = 32usize;
6115 pub const DEFAULT: Self = Self {
6116 key: CharArray::new([0_u8; 32usize]),
6117 };
6118 #[cfg(feature = "arbitrary")]
6119 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6120 use arbitrary::{Arbitrary, Unstructured};
6121 let mut buf = [0u8; 1024];
6122 rng.fill_bytes(&mut buf);
6123 let mut unstructured = Unstructured::new(&buf);
6124 Self::arbitrary(&mut unstructured).unwrap_or_default()
6125 }
6126}
6127impl Default for AUTH_KEY_DATA {
6128 fn default() -> Self {
6129 Self::DEFAULT.clone()
6130 }
6131}
6132impl MessageData for AUTH_KEY_DATA {
6133 type Message = MavMessage;
6134 const ID: u32 = 7u32;
6135 const NAME: &'static str = "AUTH_KEY";
6136 const EXTRA_CRC: u8 = 119u8;
6137 const ENCODED_LEN: usize = 32usize;
6138 fn deser(
6139 _version: MavlinkVersion,
6140 __input: &[u8],
6141 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6142 let avail_len = __input.len();
6143 let mut payload_buf = [0; Self::ENCODED_LEN];
6144 let mut buf = if avail_len < Self::ENCODED_LEN {
6145 payload_buf[0..avail_len].copy_from_slice(__input);
6146 Bytes::new(&payload_buf)
6147 } else {
6148 Bytes::new(__input)
6149 };
6150 let mut __struct = Self::default();
6151 let mut tmp = [0_u8; 32usize];
6152 for v in &mut tmp {
6153 *v = buf.get_u8()?;
6154 }
6155 __struct.key = CharArray::new(tmp);
6156 Ok(__struct)
6157 }
6158 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6159 let mut __tmp = BytesMut::new(bytes);
6160 #[allow(clippy::absurd_extreme_comparisons)]
6161 #[allow(unused_comparisons)]
6162 if __tmp.remaining() < Self::ENCODED_LEN {
6163 panic!(
6164 "buffer is too small (need {} bytes, but got {})",
6165 Self::ENCODED_LEN,
6166 __tmp.remaining(),
6167 )
6168 }
6169 for val in &self.key {
6170 __tmp.put_u8(*val);
6171 }
6172 if matches!(version, MavlinkVersion::V2) {
6173 let len = __tmp.len();
6174 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6175 } else {
6176 __tmp.len()
6177 }
6178 }
6179}
6180#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
6181#[doc = ""]
6182#[doc = "ID: 286"]
6183#[derive(Debug, Clone, PartialEq)]
6184#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6185#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6186#[cfg_attr(feature = "ts", derive(TS))]
6187#[cfg_attr(feature = "ts", ts(export))]
6188pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6189 #[doc = "Timestamp (time since system boot)."]
6190 pub time_boot_us: u64,
6191 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
6192 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6193 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6194 pub q: [f32; 4],
6195 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
6196 pub q_estimated_delay_us: u32,
6197 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
6198 pub vx: f32,
6199 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
6200 pub vy: f32,
6201 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
6202 pub vz: f32,
6203 #[doc = "Estimated delay of the speed data. 0 if unknown."]
6204 pub v_estimated_delay_us: u32,
6205 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
6206 pub feed_forward_angular_velocity_z: f32,
6207 #[doc = "Bitmap indicating which estimator outputs are valid."]
6208 pub estimator_status: EstimatorStatusFlags,
6209 #[doc = "System ID"]
6210 pub target_system: u8,
6211 #[doc = "Component ID"]
6212 pub target_component: u8,
6213 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
6214 pub landed_state: MavLandedState,
6215 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
6216 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6217 pub angular_velocity_z: f32,
6218}
6219impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6220 pub const ENCODED_LEN: usize = 57usize;
6221 pub const DEFAULT: Self = Self {
6222 time_boot_us: 0_u64,
6223 q: [0.0_f32; 4usize],
6224 q_estimated_delay_us: 0_u32,
6225 vx: 0.0_f32,
6226 vy: 0.0_f32,
6227 vz: 0.0_f32,
6228 v_estimated_delay_us: 0_u32,
6229 feed_forward_angular_velocity_z: 0.0_f32,
6230 estimator_status: EstimatorStatusFlags::DEFAULT,
6231 target_system: 0_u8,
6232 target_component: 0_u8,
6233 landed_state: MavLandedState::DEFAULT,
6234 angular_velocity_z: 0.0_f32,
6235 };
6236 #[cfg(feature = "arbitrary")]
6237 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6238 use arbitrary::{Arbitrary, Unstructured};
6239 let mut buf = [0u8; 1024];
6240 rng.fill_bytes(&mut buf);
6241 let mut unstructured = Unstructured::new(&buf);
6242 Self::arbitrary(&mut unstructured).unwrap_or_default()
6243 }
6244}
6245impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6246 fn default() -> Self {
6247 Self::DEFAULT.clone()
6248 }
6249}
6250impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6251 type Message = MavMessage;
6252 const ID: u32 = 286u32;
6253 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
6254 const EXTRA_CRC: u8 = 210u8;
6255 const ENCODED_LEN: usize = 57usize;
6256 fn deser(
6257 _version: MavlinkVersion,
6258 __input: &[u8],
6259 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6260 let avail_len = __input.len();
6261 let mut payload_buf = [0; Self::ENCODED_LEN];
6262 let mut buf = if avail_len < Self::ENCODED_LEN {
6263 payload_buf[0..avail_len].copy_from_slice(__input);
6264 Bytes::new(&payload_buf)
6265 } else {
6266 Bytes::new(__input)
6267 };
6268 let mut __struct = Self::default();
6269 __struct.time_boot_us = buf.get_u64_le()?;
6270 for v in &mut __struct.q {
6271 let val = buf.get_f32_le()?;
6272 *v = val;
6273 }
6274 __struct.q_estimated_delay_us = buf.get_u32_le()?;
6275 __struct.vx = buf.get_f32_le()?;
6276 __struct.vy = buf.get_f32_le()?;
6277 __struct.vz = buf.get_f32_le()?;
6278 __struct.v_estimated_delay_us = buf.get_u32_le()?;
6279 __struct.feed_forward_angular_velocity_z = buf.get_f32_le()?;
6280 let tmp = buf.get_u16_le()?;
6281 __struct.estimator_status = EstimatorStatusFlags::from_bits(
6282 tmp as <EstimatorStatusFlags as Flags>::Bits,
6283 )
6284 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6285 flag_type: "EstimatorStatusFlags",
6286 value: tmp as u64,
6287 })?;
6288 __struct.target_system = buf.get_u8()?;
6289 __struct.target_component = buf.get_u8()?;
6290 let tmp = buf.get_u8()?;
6291 __struct.landed_state =
6292 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6293 enum_type: "MavLandedState",
6294 value: tmp as u64,
6295 })?;
6296 __struct.angular_velocity_z = buf.get_f32_le()?;
6297 Ok(__struct)
6298 }
6299 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6300 let mut __tmp = BytesMut::new(bytes);
6301 #[allow(clippy::absurd_extreme_comparisons)]
6302 #[allow(unused_comparisons)]
6303 if __tmp.remaining() < Self::ENCODED_LEN {
6304 panic!(
6305 "buffer is too small (need {} bytes, but got {})",
6306 Self::ENCODED_LEN,
6307 __tmp.remaining(),
6308 )
6309 }
6310 __tmp.put_u64_le(self.time_boot_us);
6311 for val in &self.q {
6312 __tmp.put_f32_le(*val);
6313 }
6314 __tmp.put_u32_le(self.q_estimated_delay_us);
6315 __tmp.put_f32_le(self.vx);
6316 __tmp.put_f32_le(self.vy);
6317 __tmp.put_f32_le(self.vz);
6318 __tmp.put_u32_le(self.v_estimated_delay_us);
6319 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
6320 __tmp.put_u16_le(self.estimator_status.bits() as u16);
6321 __tmp.put_u8(self.target_system);
6322 __tmp.put_u8(self.target_component);
6323 __tmp.put_u8(self.landed_state as u8);
6324 if matches!(version, MavlinkVersion::V2) {
6325 __tmp.put_f32_le(self.angular_velocity_z);
6326 let len = __tmp.len();
6327 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6328 } else {
6329 __tmp.len()
6330 }
6331 }
6332}
6333#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
6334#[doc = ""]
6335#[doc = "ID: 148"]
6336#[derive(Debug, Clone, PartialEq)]
6337#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6338#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6339#[cfg_attr(feature = "ts", derive(TS))]
6340#[cfg_attr(feature = "ts", ts(export))]
6341pub struct AUTOPILOT_VERSION_DATA {
6342 #[doc = "Bitmap of capabilities"]
6343 pub capabilities: MavProtocolCapability,
6344 #[doc = "UID if provided by hardware (see uid2)"]
6345 pub uid: u64,
6346 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
6347 pub flight_sw_version: u32,
6348 #[doc = "Middleware version number"]
6349 pub middleware_sw_version: u32,
6350 #[doc = "Operating system version number"]
6351 pub os_sw_version: u32,
6352 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
6353 pub board_version: u32,
6354 #[doc = "ID of the board vendor"]
6355 pub vendor_id: u16,
6356 #[doc = "ID of the product"]
6357 pub product_id: u16,
6358 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6359 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6360 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6361 pub flight_custom_version: [u8; 8],
6362 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6363 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6364 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6365 pub middleware_custom_version: [u8; 8],
6366 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6367 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6368 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6369 pub os_custom_version: [u8; 8],
6370 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
6371 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6372 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6373 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6374 pub uid2: [u8; 18],
6375}
6376impl AUTOPILOT_VERSION_DATA {
6377 pub const ENCODED_LEN: usize = 78usize;
6378 pub const DEFAULT: Self = Self {
6379 capabilities: MavProtocolCapability::DEFAULT,
6380 uid: 0_u64,
6381 flight_sw_version: 0_u32,
6382 middleware_sw_version: 0_u32,
6383 os_sw_version: 0_u32,
6384 board_version: 0_u32,
6385 vendor_id: 0_u16,
6386 product_id: 0_u16,
6387 flight_custom_version: [0_u8; 8usize],
6388 middleware_custom_version: [0_u8; 8usize],
6389 os_custom_version: [0_u8; 8usize],
6390 uid2: [0_u8; 18usize],
6391 };
6392 #[cfg(feature = "arbitrary")]
6393 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6394 use arbitrary::{Arbitrary, Unstructured};
6395 let mut buf = [0u8; 1024];
6396 rng.fill_bytes(&mut buf);
6397 let mut unstructured = Unstructured::new(&buf);
6398 Self::arbitrary(&mut unstructured).unwrap_or_default()
6399 }
6400}
6401impl Default for AUTOPILOT_VERSION_DATA {
6402 fn default() -> Self {
6403 Self::DEFAULT.clone()
6404 }
6405}
6406impl MessageData for AUTOPILOT_VERSION_DATA {
6407 type Message = MavMessage;
6408 const ID: u32 = 148u32;
6409 const NAME: &'static str = "AUTOPILOT_VERSION";
6410 const EXTRA_CRC: u8 = 178u8;
6411 const ENCODED_LEN: usize = 78usize;
6412 fn deser(
6413 _version: MavlinkVersion,
6414 __input: &[u8],
6415 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6416 let avail_len = __input.len();
6417 let mut payload_buf = [0; Self::ENCODED_LEN];
6418 let mut buf = if avail_len < Self::ENCODED_LEN {
6419 payload_buf[0..avail_len].copy_from_slice(__input);
6420 Bytes::new(&payload_buf)
6421 } else {
6422 Bytes::new(__input)
6423 };
6424 let mut __struct = Self::default();
6425 let tmp = buf.get_u64_le()?;
6426 __struct.capabilities = MavProtocolCapability::from_bits(
6427 tmp as <MavProtocolCapability as Flags>::Bits,
6428 )
6429 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6430 flag_type: "MavProtocolCapability",
6431 value: tmp as u64,
6432 })?;
6433 __struct.uid = buf.get_u64_le()?;
6434 __struct.flight_sw_version = buf.get_u32_le()?;
6435 __struct.middleware_sw_version = buf.get_u32_le()?;
6436 __struct.os_sw_version = buf.get_u32_le()?;
6437 __struct.board_version = buf.get_u32_le()?;
6438 __struct.vendor_id = buf.get_u16_le()?;
6439 __struct.product_id = buf.get_u16_le()?;
6440 for v in &mut __struct.flight_custom_version {
6441 let val = buf.get_u8()?;
6442 *v = val;
6443 }
6444 for v in &mut __struct.middleware_custom_version {
6445 let val = buf.get_u8()?;
6446 *v = val;
6447 }
6448 for v in &mut __struct.os_custom_version {
6449 let val = buf.get_u8()?;
6450 *v = val;
6451 }
6452 for v in &mut __struct.uid2 {
6453 let val = buf.get_u8()?;
6454 *v = val;
6455 }
6456 Ok(__struct)
6457 }
6458 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6459 let mut __tmp = BytesMut::new(bytes);
6460 #[allow(clippy::absurd_extreme_comparisons)]
6461 #[allow(unused_comparisons)]
6462 if __tmp.remaining() < Self::ENCODED_LEN {
6463 panic!(
6464 "buffer is too small (need {} bytes, but got {})",
6465 Self::ENCODED_LEN,
6466 __tmp.remaining(),
6467 )
6468 }
6469 __tmp.put_u64_le(self.capabilities.bits() as u64);
6470 __tmp.put_u64_le(self.uid);
6471 __tmp.put_u32_le(self.flight_sw_version);
6472 __tmp.put_u32_le(self.middleware_sw_version);
6473 __tmp.put_u32_le(self.os_sw_version);
6474 __tmp.put_u32_le(self.board_version);
6475 __tmp.put_u16_le(self.vendor_id);
6476 __tmp.put_u16_le(self.product_id);
6477 for val in &self.flight_custom_version {
6478 __tmp.put_u8(*val);
6479 }
6480 for val in &self.middleware_custom_version {
6481 __tmp.put_u8(*val);
6482 }
6483 for val in &self.os_custom_version {
6484 __tmp.put_u8(*val);
6485 }
6486 if matches!(version, MavlinkVersion::V2) {
6487 for val in &self.uid2 {
6488 __tmp.put_u8(*val);
6489 }
6490 let len = __tmp.len();
6491 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6492 } else {
6493 __tmp.len()
6494 }
6495 }
6496}
6497#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
6498#[doc = ""]
6499#[doc = "ID: 435"]
6500#[derive(Debug, Clone, PartialEq)]
6501#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6502#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6503#[cfg_attr(feature = "ts", derive(TS))]
6504#[cfg_attr(feature = "ts", ts(export))]
6505pub struct AVAILABLE_MODES_DATA {
6506 #[doc = "A bitfield for use for autopilot-specific flags"]
6507 pub custom_mode: u32,
6508 #[doc = "Mode properties."]
6509 pub properties: MavModeProperty,
6510 #[doc = "The total number of available modes for the current vehicle type."]
6511 pub number_modes: u8,
6512 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
6513 pub mode_index: u8,
6514 #[doc = "Standard mode."]
6515 pub standard_mode: MavStandardMode,
6516 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
6517 #[cfg_attr(feature = "ts", ts(type = "string"))]
6518 pub mode_name: CharArray<35>,
6519}
6520impl AVAILABLE_MODES_DATA {
6521 pub const ENCODED_LEN: usize = 46usize;
6522 pub const DEFAULT: Self = Self {
6523 custom_mode: 0_u32,
6524 properties: MavModeProperty::DEFAULT,
6525 number_modes: 0_u8,
6526 mode_index: 0_u8,
6527 standard_mode: MavStandardMode::DEFAULT,
6528 mode_name: CharArray::new([0_u8; 35usize]),
6529 };
6530 #[cfg(feature = "arbitrary")]
6531 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6532 use arbitrary::{Arbitrary, Unstructured};
6533 let mut buf = [0u8; 1024];
6534 rng.fill_bytes(&mut buf);
6535 let mut unstructured = Unstructured::new(&buf);
6536 Self::arbitrary(&mut unstructured).unwrap_or_default()
6537 }
6538}
6539impl Default for AVAILABLE_MODES_DATA {
6540 fn default() -> Self {
6541 Self::DEFAULT.clone()
6542 }
6543}
6544impl MessageData for AVAILABLE_MODES_DATA {
6545 type Message = MavMessage;
6546 const ID: u32 = 435u32;
6547 const NAME: &'static str = "AVAILABLE_MODES";
6548 const EXTRA_CRC: u8 = 134u8;
6549 const ENCODED_LEN: usize = 46usize;
6550 fn deser(
6551 _version: MavlinkVersion,
6552 __input: &[u8],
6553 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6554 let avail_len = __input.len();
6555 let mut payload_buf = [0; Self::ENCODED_LEN];
6556 let mut buf = if avail_len < Self::ENCODED_LEN {
6557 payload_buf[0..avail_len].copy_from_slice(__input);
6558 Bytes::new(&payload_buf)
6559 } else {
6560 Bytes::new(__input)
6561 };
6562 let mut __struct = Self::default();
6563 __struct.custom_mode = buf.get_u32_le()?;
6564 let tmp = buf.get_u32_le()?;
6565 __struct.properties = MavModeProperty::from_bits(tmp as <MavModeProperty as Flags>::Bits)
6566 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6567 flag_type: "MavModeProperty",
6568 value: tmp as u64,
6569 })?;
6570 __struct.number_modes = buf.get_u8()?;
6571 __struct.mode_index = buf.get_u8()?;
6572 let tmp = buf.get_u8()?;
6573 __struct.standard_mode =
6574 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6575 enum_type: "MavStandardMode",
6576 value: tmp as u64,
6577 })?;
6578 let mut tmp = [0_u8; 35usize];
6579 for v in &mut tmp {
6580 *v = buf.get_u8()?;
6581 }
6582 __struct.mode_name = CharArray::new(tmp);
6583 Ok(__struct)
6584 }
6585 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6586 let mut __tmp = BytesMut::new(bytes);
6587 #[allow(clippy::absurd_extreme_comparisons)]
6588 #[allow(unused_comparisons)]
6589 if __tmp.remaining() < Self::ENCODED_LEN {
6590 panic!(
6591 "buffer is too small (need {} bytes, but got {})",
6592 Self::ENCODED_LEN,
6593 __tmp.remaining(),
6594 )
6595 }
6596 __tmp.put_u32_le(self.custom_mode);
6597 __tmp.put_u32_le(self.properties.bits() as u32);
6598 __tmp.put_u8(self.number_modes);
6599 __tmp.put_u8(self.mode_index);
6600 __tmp.put_u8(self.standard_mode as u8);
6601 for val in &self.mode_name {
6602 __tmp.put_u8(*val);
6603 }
6604 if matches!(version, MavlinkVersion::V2) {
6605 let len = __tmp.len();
6606 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6607 } else {
6608 __tmp.len()
6609 }
6610 }
6611}
6612#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6613#[doc = ""]
6614#[doc = "ID: 437"]
6615#[derive(Debug, Clone, PartialEq)]
6616#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6617#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6618#[cfg_attr(feature = "ts", derive(TS))]
6619#[cfg_attr(feature = "ts", ts(export))]
6620pub struct AVAILABLE_MODES_MONITOR_DATA {
6621 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6622 pub seq: u8,
6623}
6624impl AVAILABLE_MODES_MONITOR_DATA {
6625 pub const ENCODED_LEN: usize = 1usize;
6626 pub const DEFAULT: Self = Self { seq: 0_u8 };
6627 #[cfg(feature = "arbitrary")]
6628 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6629 use arbitrary::{Arbitrary, Unstructured};
6630 let mut buf = [0u8; 1024];
6631 rng.fill_bytes(&mut buf);
6632 let mut unstructured = Unstructured::new(&buf);
6633 Self::arbitrary(&mut unstructured).unwrap_or_default()
6634 }
6635}
6636impl Default for AVAILABLE_MODES_MONITOR_DATA {
6637 fn default() -> Self {
6638 Self::DEFAULT.clone()
6639 }
6640}
6641impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6642 type Message = MavMessage;
6643 const ID: u32 = 437u32;
6644 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6645 const EXTRA_CRC: u8 = 30u8;
6646 const ENCODED_LEN: usize = 1usize;
6647 fn deser(
6648 _version: MavlinkVersion,
6649 __input: &[u8],
6650 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6651 let avail_len = __input.len();
6652 let mut payload_buf = [0; Self::ENCODED_LEN];
6653 let mut buf = if avail_len < Self::ENCODED_LEN {
6654 payload_buf[0..avail_len].copy_from_slice(__input);
6655 Bytes::new(&payload_buf)
6656 } else {
6657 Bytes::new(__input)
6658 };
6659 let mut __struct = Self::default();
6660 __struct.seq = buf.get_u8()?;
6661 Ok(__struct)
6662 }
6663 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6664 let mut __tmp = BytesMut::new(bytes);
6665 #[allow(clippy::absurd_extreme_comparisons)]
6666 #[allow(unused_comparisons)]
6667 if __tmp.remaining() < Self::ENCODED_LEN {
6668 panic!(
6669 "buffer is too small (need {} bytes, but got {})",
6670 Self::ENCODED_LEN,
6671 __tmp.remaining(),
6672 )
6673 }
6674 __tmp.put_u8(self.seq);
6675 if matches!(version, MavlinkVersion::V2) {
6676 let len = __tmp.len();
6677 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6678 } else {
6679 __tmp.len()
6680 }
6681 }
6682}
6683#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
6684#[doc = ""]
6685#[doc = "ID: 372"]
6686#[derive(Debug, Clone, PartialEq)]
6687#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6688#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6689#[cfg_attr(feature = "ts", derive(TS))]
6690#[cfg_attr(feature = "ts", ts(export))]
6691pub struct BATTERY_INFO_DATA {
6692 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
6693 pub discharge_minimum_voltage: f32,
6694 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
6695 pub charging_minimum_voltage: f32,
6696 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
6697 pub resting_minimum_voltage: f32,
6698 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
6699 pub charging_maximum_voltage: f32,
6700 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
6701 pub charging_maximum_current: f32,
6702 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
6703 pub nominal_voltage: f32,
6704 #[doc = "Maximum pack discharge current. 0: field not provided."]
6705 pub discharge_maximum_current: f32,
6706 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
6707 pub discharge_maximum_burst_current: f32,
6708 #[doc = "Fully charged design capacity. 0: field not provided."]
6709 pub design_capacity: f32,
6710 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
6711 pub full_charge_capacity: f32,
6712 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
6713 pub cycle_count: u16,
6714 #[doc = "Battery weight. 0: field not provided."]
6715 pub weight: u16,
6716 #[doc = "Battery ID"]
6717 pub id: u8,
6718 #[doc = "Function of the battery."]
6719 pub battery_function: MavBatteryFunction,
6720 #[doc = "Type (chemistry) of the battery."]
6721 pub mavtype: MavBatteryType,
6722 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
6723 pub state_of_health: u8,
6724 #[doc = "Number of battery cells in series. 0: field not provided."]
6725 pub cells_in_series: u8,
6726 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
6727 #[cfg_attr(feature = "ts", ts(type = "string"))]
6728 pub manufacture_date: CharArray<9>,
6729 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
6730 #[cfg_attr(feature = "ts", ts(type = "string"))]
6731 pub serial_number: CharArray<32>,
6732 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
6733 #[cfg_attr(feature = "ts", ts(type = "string"))]
6734 pub name: CharArray<50>,
6735}
6736impl BATTERY_INFO_DATA {
6737 pub const ENCODED_LEN: usize = 140usize;
6738 pub const DEFAULT: Self = Self {
6739 discharge_minimum_voltage: 0.0_f32,
6740 charging_minimum_voltage: 0.0_f32,
6741 resting_minimum_voltage: 0.0_f32,
6742 charging_maximum_voltage: 0.0_f32,
6743 charging_maximum_current: 0.0_f32,
6744 nominal_voltage: 0.0_f32,
6745 discharge_maximum_current: 0.0_f32,
6746 discharge_maximum_burst_current: 0.0_f32,
6747 design_capacity: 0.0_f32,
6748 full_charge_capacity: 0.0_f32,
6749 cycle_count: 0_u16,
6750 weight: 0_u16,
6751 id: 0_u8,
6752 battery_function: MavBatteryFunction::DEFAULT,
6753 mavtype: MavBatteryType::DEFAULT,
6754 state_of_health: 0_u8,
6755 cells_in_series: 0_u8,
6756 manufacture_date: CharArray::new([0_u8; 9usize]),
6757 serial_number: CharArray::new([0_u8; 32usize]),
6758 name: CharArray::new([0_u8; 50usize]),
6759 };
6760 #[cfg(feature = "arbitrary")]
6761 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6762 use arbitrary::{Arbitrary, Unstructured};
6763 let mut buf = [0u8; 1024];
6764 rng.fill_bytes(&mut buf);
6765 let mut unstructured = Unstructured::new(&buf);
6766 Self::arbitrary(&mut unstructured).unwrap_or_default()
6767 }
6768}
6769impl Default for BATTERY_INFO_DATA {
6770 fn default() -> Self {
6771 Self::DEFAULT.clone()
6772 }
6773}
6774impl MessageData for BATTERY_INFO_DATA {
6775 type Message = MavMessage;
6776 const ID: u32 = 372u32;
6777 const NAME: &'static str = "BATTERY_INFO";
6778 const EXTRA_CRC: u8 = 26u8;
6779 const ENCODED_LEN: usize = 140usize;
6780 fn deser(
6781 _version: MavlinkVersion,
6782 __input: &[u8],
6783 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6784 let avail_len = __input.len();
6785 let mut payload_buf = [0; Self::ENCODED_LEN];
6786 let mut buf = if avail_len < Self::ENCODED_LEN {
6787 payload_buf[0..avail_len].copy_from_slice(__input);
6788 Bytes::new(&payload_buf)
6789 } else {
6790 Bytes::new(__input)
6791 };
6792 let mut __struct = Self::default();
6793 __struct.discharge_minimum_voltage = buf.get_f32_le()?;
6794 __struct.charging_minimum_voltage = buf.get_f32_le()?;
6795 __struct.resting_minimum_voltage = buf.get_f32_le()?;
6796 __struct.charging_maximum_voltage = buf.get_f32_le()?;
6797 __struct.charging_maximum_current = buf.get_f32_le()?;
6798 __struct.nominal_voltage = buf.get_f32_le()?;
6799 __struct.discharge_maximum_current = buf.get_f32_le()?;
6800 __struct.discharge_maximum_burst_current = buf.get_f32_le()?;
6801 __struct.design_capacity = buf.get_f32_le()?;
6802 __struct.full_charge_capacity = buf.get_f32_le()?;
6803 __struct.cycle_count = buf.get_u16_le()?;
6804 __struct.weight = buf.get_u16_le()?;
6805 __struct.id = buf.get_u8()?;
6806 let tmp = buf.get_u8()?;
6807 __struct.battery_function =
6808 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6809 enum_type: "MavBatteryFunction",
6810 value: tmp as u64,
6811 })?;
6812 let tmp = buf.get_u8()?;
6813 __struct.mavtype =
6814 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6815 enum_type: "MavBatteryType",
6816 value: tmp as u64,
6817 })?;
6818 __struct.state_of_health = buf.get_u8()?;
6819 __struct.cells_in_series = buf.get_u8()?;
6820 let mut tmp = [0_u8; 9usize];
6821 for v in &mut tmp {
6822 *v = buf.get_u8()?;
6823 }
6824 __struct.manufacture_date = CharArray::new(tmp);
6825 let mut tmp = [0_u8; 32usize];
6826 for v in &mut tmp {
6827 *v = buf.get_u8()?;
6828 }
6829 __struct.serial_number = CharArray::new(tmp);
6830 let mut tmp = [0_u8; 50usize];
6831 for v in &mut tmp {
6832 *v = buf.get_u8()?;
6833 }
6834 __struct.name = CharArray::new(tmp);
6835 Ok(__struct)
6836 }
6837 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6838 let mut __tmp = BytesMut::new(bytes);
6839 #[allow(clippy::absurd_extreme_comparisons)]
6840 #[allow(unused_comparisons)]
6841 if __tmp.remaining() < Self::ENCODED_LEN {
6842 panic!(
6843 "buffer is too small (need {} bytes, but got {})",
6844 Self::ENCODED_LEN,
6845 __tmp.remaining(),
6846 )
6847 }
6848 __tmp.put_f32_le(self.discharge_minimum_voltage);
6849 __tmp.put_f32_le(self.charging_minimum_voltage);
6850 __tmp.put_f32_le(self.resting_minimum_voltage);
6851 __tmp.put_f32_le(self.charging_maximum_voltage);
6852 __tmp.put_f32_le(self.charging_maximum_current);
6853 __tmp.put_f32_le(self.nominal_voltage);
6854 __tmp.put_f32_le(self.discharge_maximum_current);
6855 __tmp.put_f32_le(self.discharge_maximum_burst_current);
6856 __tmp.put_f32_le(self.design_capacity);
6857 __tmp.put_f32_le(self.full_charge_capacity);
6858 __tmp.put_u16_le(self.cycle_count);
6859 __tmp.put_u16_le(self.weight);
6860 __tmp.put_u8(self.id);
6861 __tmp.put_u8(self.battery_function as u8);
6862 __tmp.put_u8(self.mavtype as u8);
6863 __tmp.put_u8(self.state_of_health);
6864 __tmp.put_u8(self.cells_in_series);
6865 for val in &self.manufacture_date {
6866 __tmp.put_u8(*val);
6867 }
6868 for val in &self.serial_number {
6869 __tmp.put_u8(*val);
6870 }
6871 for val in &self.name {
6872 __tmp.put_u8(*val);
6873 }
6874 if matches!(version, MavlinkVersion::V2) {
6875 let len = __tmp.len();
6876 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6877 } else {
6878 __tmp.len()
6879 }
6880 }
6881}
6882#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
6883#[doc = ""]
6884#[doc = "ID: 147"]
6885#[derive(Debug, Clone, PartialEq)]
6886#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6887#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6888#[cfg_attr(feature = "ts", derive(TS))]
6889#[cfg_attr(feature = "ts", ts(export))]
6890pub struct BATTERY_STATUS_DATA {
6891 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
6892 pub current_consumed: i32,
6893 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
6894 pub energy_consumed: i32,
6895 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
6896 pub temperature: i16,
6897 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
6898 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6899 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6900 pub voltages: [u16; 10],
6901 #[doc = "Battery current, -1: autopilot does not measure the current"]
6902 pub current_battery: i16,
6903 #[doc = "Battery ID"]
6904 pub id: u8,
6905 #[doc = "Function of the battery"]
6906 pub battery_function: MavBatteryFunction,
6907 #[doc = "Type (chemistry) of the battery"]
6908 pub mavtype: MavBatteryType,
6909 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
6910 pub battery_remaining: i8,
6911 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
6912 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6913 pub time_remaining: i32,
6914 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
6915 #[cfg_attr(feature = "serde", serde(default))]
6916 pub charge_state: MavBatteryChargeState,
6917 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
6918 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6919 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6920 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6921 pub voltages_ext: [u16; 4],
6922 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
6923 #[cfg_attr(feature = "serde", serde(default))]
6924 pub mode: MavBatteryMode,
6925 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
6926 #[cfg_attr(feature = "serde", serde(default))]
6927 pub fault_bitmask: MavBatteryFault,
6928}
6929impl BATTERY_STATUS_DATA {
6930 pub const ENCODED_LEN: usize = 54usize;
6931 pub const DEFAULT: Self = Self {
6932 current_consumed: 0_i32,
6933 energy_consumed: 0_i32,
6934 temperature: 0_i16,
6935 voltages: [0_u16; 10usize],
6936 current_battery: 0_i16,
6937 id: 0_u8,
6938 battery_function: MavBatteryFunction::DEFAULT,
6939 mavtype: MavBatteryType::DEFAULT,
6940 battery_remaining: 0_i8,
6941 time_remaining: 0_i32,
6942 charge_state: MavBatteryChargeState::DEFAULT,
6943 voltages_ext: [0_u16; 4usize],
6944 mode: MavBatteryMode::DEFAULT,
6945 fault_bitmask: MavBatteryFault::DEFAULT,
6946 };
6947 #[cfg(feature = "arbitrary")]
6948 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6949 use arbitrary::{Arbitrary, Unstructured};
6950 let mut buf = [0u8; 1024];
6951 rng.fill_bytes(&mut buf);
6952 let mut unstructured = Unstructured::new(&buf);
6953 Self::arbitrary(&mut unstructured).unwrap_or_default()
6954 }
6955}
6956impl Default for BATTERY_STATUS_DATA {
6957 fn default() -> Self {
6958 Self::DEFAULT.clone()
6959 }
6960}
6961impl MessageData for BATTERY_STATUS_DATA {
6962 type Message = MavMessage;
6963 const ID: u32 = 147u32;
6964 const NAME: &'static str = "BATTERY_STATUS";
6965 const EXTRA_CRC: u8 = 154u8;
6966 const ENCODED_LEN: usize = 54usize;
6967 fn deser(
6968 _version: MavlinkVersion,
6969 __input: &[u8],
6970 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6971 let avail_len = __input.len();
6972 let mut payload_buf = [0; Self::ENCODED_LEN];
6973 let mut buf = if avail_len < Self::ENCODED_LEN {
6974 payload_buf[0..avail_len].copy_from_slice(__input);
6975 Bytes::new(&payload_buf)
6976 } else {
6977 Bytes::new(__input)
6978 };
6979 let mut __struct = Self::default();
6980 __struct.current_consumed = buf.get_i32_le()?;
6981 __struct.energy_consumed = buf.get_i32_le()?;
6982 __struct.temperature = buf.get_i16_le()?;
6983 for v in &mut __struct.voltages {
6984 let val = buf.get_u16_le()?;
6985 *v = val;
6986 }
6987 __struct.current_battery = buf.get_i16_le()?;
6988 __struct.id = buf.get_u8()?;
6989 let tmp = buf.get_u8()?;
6990 __struct.battery_function =
6991 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6992 enum_type: "MavBatteryFunction",
6993 value: tmp as u64,
6994 })?;
6995 let tmp = buf.get_u8()?;
6996 __struct.mavtype =
6997 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6998 enum_type: "MavBatteryType",
6999 value: tmp as u64,
7000 })?;
7001 __struct.battery_remaining = buf.get_i8()?;
7002 __struct.time_remaining = buf.get_i32_le()?;
7003 let tmp = buf.get_u8()?;
7004 __struct.charge_state =
7005 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7006 enum_type: "MavBatteryChargeState",
7007 value: tmp as u64,
7008 })?;
7009 for v in &mut __struct.voltages_ext {
7010 let val = buf.get_u16_le()?;
7011 *v = val;
7012 }
7013 let tmp = buf.get_u8()?;
7014 __struct.mode =
7015 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7016 enum_type: "MavBatteryMode",
7017 value: tmp as u64,
7018 })?;
7019 let tmp = buf.get_u32_le()?;
7020 __struct.fault_bitmask = MavBatteryFault::from_bits(
7021 tmp as <MavBatteryFault as Flags>::Bits,
7022 )
7023 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7024 flag_type: "MavBatteryFault",
7025 value: tmp as u64,
7026 })?;
7027 Ok(__struct)
7028 }
7029 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7030 let mut __tmp = BytesMut::new(bytes);
7031 #[allow(clippy::absurd_extreme_comparisons)]
7032 #[allow(unused_comparisons)]
7033 if __tmp.remaining() < Self::ENCODED_LEN {
7034 panic!(
7035 "buffer is too small (need {} bytes, but got {})",
7036 Self::ENCODED_LEN,
7037 __tmp.remaining(),
7038 )
7039 }
7040 __tmp.put_i32_le(self.current_consumed);
7041 __tmp.put_i32_le(self.energy_consumed);
7042 __tmp.put_i16_le(self.temperature);
7043 for val in &self.voltages {
7044 __tmp.put_u16_le(*val);
7045 }
7046 __tmp.put_i16_le(self.current_battery);
7047 __tmp.put_u8(self.id);
7048 __tmp.put_u8(self.battery_function as u8);
7049 __tmp.put_u8(self.mavtype as u8);
7050 __tmp.put_i8(self.battery_remaining);
7051 if matches!(version, MavlinkVersion::V2) {
7052 __tmp.put_i32_le(self.time_remaining);
7053 __tmp.put_u8(self.charge_state as u8);
7054 for val in &self.voltages_ext {
7055 __tmp.put_u16_le(*val);
7056 }
7057 __tmp.put_u8(self.mode as u8);
7058 __tmp.put_u32_le(self.fault_bitmask.bits() as u32);
7059 let len = __tmp.len();
7060 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7061 } else {
7062 __tmp.len()
7063 }
7064 }
7065}
7066#[doc = "Report button state change."]
7067#[doc = ""]
7068#[doc = "ID: 257"]
7069#[derive(Debug, Clone, PartialEq)]
7070#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7071#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7072#[cfg_attr(feature = "ts", derive(TS))]
7073#[cfg_attr(feature = "ts", ts(export))]
7074pub struct BUTTON_CHANGE_DATA {
7075 #[doc = "Timestamp (time since system boot)."]
7076 pub time_boot_ms: u32,
7077 #[doc = "Time of last change of button state."]
7078 pub last_change_ms: u32,
7079 #[doc = "Bitmap for state of buttons."]
7080 pub state: u8,
7081}
7082impl BUTTON_CHANGE_DATA {
7083 pub const ENCODED_LEN: usize = 9usize;
7084 pub const DEFAULT: Self = Self {
7085 time_boot_ms: 0_u32,
7086 last_change_ms: 0_u32,
7087 state: 0_u8,
7088 };
7089 #[cfg(feature = "arbitrary")]
7090 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7091 use arbitrary::{Arbitrary, Unstructured};
7092 let mut buf = [0u8; 1024];
7093 rng.fill_bytes(&mut buf);
7094 let mut unstructured = Unstructured::new(&buf);
7095 Self::arbitrary(&mut unstructured).unwrap_or_default()
7096 }
7097}
7098impl Default for BUTTON_CHANGE_DATA {
7099 fn default() -> Self {
7100 Self::DEFAULT.clone()
7101 }
7102}
7103impl MessageData for BUTTON_CHANGE_DATA {
7104 type Message = MavMessage;
7105 const ID: u32 = 257u32;
7106 const NAME: &'static str = "BUTTON_CHANGE";
7107 const EXTRA_CRC: u8 = 131u8;
7108 const ENCODED_LEN: usize = 9usize;
7109 fn deser(
7110 _version: MavlinkVersion,
7111 __input: &[u8],
7112 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7113 let avail_len = __input.len();
7114 let mut payload_buf = [0; Self::ENCODED_LEN];
7115 let mut buf = if avail_len < Self::ENCODED_LEN {
7116 payload_buf[0..avail_len].copy_from_slice(__input);
7117 Bytes::new(&payload_buf)
7118 } else {
7119 Bytes::new(__input)
7120 };
7121 let mut __struct = Self::default();
7122 __struct.time_boot_ms = buf.get_u32_le()?;
7123 __struct.last_change_ms = buf.get_u32_le()?;
7124 __struct.state = buf.get_u8()?;
7125 Ok(__struct)
7126 }
7127 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7128 let mut __tmp = BytesMut::new(bytes);
7129 #[allow(clippy::absurd_extreme_comparisons)]
7130 #[allow(unused_comparisons)]
7131 if __tmp.remaining() < Self::ENCODED_LEN {
7132 panic!(
7133 "buffer is too small (need {} bytes, but got {})",
7134 Self::ENCODED_LEN,
7135 __tmp.remaining(),
7136 )
7137 }
7138 __tmp.put_u32_le(self.time_boot_ms);
7139 __tmp.put_u32_le(self.last_change_ms);
7140 __tmp.put_u8(self.state);
7141 if matches!(version, MavlinkVersion::V2) {
7142 let len = __tmp.len();
7143 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7144 } else {
7145 __tmp.len()
7146 }
7147 }
7148}
7149#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7150#[doc = ""]
7151#[doc = "ID: 262"]
7152#[derive(Debug, Clone, PartialEq)]
7153#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7154#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7155#[cfg_attr(feature = "ts", derive(TS))]
7156#[cfg_attr(feature = "ts", ts(export))]
7157pub struct CAMERA_CAPTURE_STATUS_DATA {
7158 #[doc = "Timestamp (time since system boot)."]
7159 pub time_boot_ms: u32,
7160 #[doc = "Image capture interval"]
7161 pub image_interval: f32,
7162 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
7163 pub recording_time_ms: u32,
7164 #[doc = "Available storage capacity."]
7165 pub available_capacity: f32,
7166 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
7167 pub image_status: u8,
7168 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
7169 pub video_status: u8,
7170 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
7171 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7172 pub image_count: i32,
7173 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7174 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7175 pub camera_device_id: u8,
7176}
7177impl CAMERA_CAPTURE_STATUS_DATA {
7178 pub const ENCODED_LEN: usize = 23usize;
7179 pub const DEFAULT: Self = Self {
7180 time_boot_ms: 0_u32,
7181 image_interval: 0.0_f32,
7182 recording_time_ms: 0_u32,
7183 available_capacity: 0.0_f32,
7184 image_status: 0_u8,
7185 video_status: 0_u8,
7186 image_count: 0_i32,
7187 camera_device_id: 0_u8,
7188 };
7189 #[cfg(feature = "arbitrary")]
7190 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7191 use arbitrary::{Arbitrary, Unstructured};
7192 let mut buf = [0u8; 1024];
7193 rng.fill_bytes(&mut buf);
7194 let mut unstructured = Unstructured::new(&buf);
7195 Self::arbitrary(&mut unstructured).unwrap_or_default()
7196 }
7197}
7198impl Default for CAMERA_CAPTURE_STATUS_DATA {
7199 fn default() -> Self {
7200 Self::DEFAULT.clone()
7201 }
7202}
7203impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
7204 type Message = MavMessage;
7205 const ID: u32 = 262u32;
7206 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
7207 const EXTRA_CRC: u8 = 12u8;
7208 const ENCODED_LEN: usize = 23usize;
7209 fn deser(
7210 _version: MavlinkVersion,
7211 __input: &[u8],
7212 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7213 let avail_len = __input.len();
7214 let mut payload_buf = [0; Self::ENCODED_LEN];
7215 let mut buf = if avail_len < Self::ENCODED_LEN {
7216 payload_buf[0..avail_len].copy_from_slice(__input);
7217 Bytes::new(&payload_buf)
7218 } else {
7219 Bytes::new(__input)
7220 };
7221 let mut __struct = Self::default();
7222 __struct.time_boot_ms = buf.get_u32_le()?;
7223 __struct.image_interval = buf.get_f32_le()?;
7224 __struct.recording_time_ms = buf.get_u32_le()?;
7225 __struct.available_capacity = buf.get_f32_le()?;
7226 __struct.image_status = buf.get_u8()?;
7227 __struct.video_status = buf.get_u8()?;
7228 __struct.image_count = buf.get_i32_le()?;
7229 __struct.camera_device_id = buf.get_u8()?;
7230 Ok(__struct)
7231 }
7232 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7233 let mut __tmp = BytesMut::new(bytes);
7234 #[allow(clippy::absurd_extreme_comparisons)]
7235 #[allow(unused_comparisons)]
7236 if __tmp.remaining() < Self::ENCODED_LEN {
7237 panic!(
7238 "buffer is too small (need {} bytes, but got {})",
7239 Self::ENCODED_LEN,
7240 __tmp.remaining(),
7241 )
7242 }
7243 __tmp.put_u32_le(self.time_boot_ms);
7244 __tmp.put_f32_le(self.image_interval);
7245 __tmp.put_u32_le(self.recording_time_ms);
7246 __tmp.put_f32_le(self.available_capacity);
7247 __tmp.put_u8(self.image_status);
7248 __tmp.put_u8(self.video_status);
7249 if matches!(version, MavlinkVersion::V2) {
7250 __tmp.put_i32_le(self.image_count);
7251 __tmp.put_u8(self.camera_device_id);
7252 let len = __tmp.len();
7253 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7254 } else {
7255 __tmp.len()
7256 }
7257 }
7258}
7259#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7260#[doc = ""]
7261#[doc = "ID: 271"]
7262#[derive(Debug, Clone, PartialEq)]
7263#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7264#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7265#[cfg_attr(feature = "ts", derive(TS))]
7266#[cfg_attr(feature = "ts", ts(export))]
7267pub struct CAMERA_FOV_STATUS_DATA {
7268 #[doc = "Timestamp (time since system boot)."]
7269 pub time_boot_ms: u32,
7270 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
7271 pub lat_camera: i32,
7272 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
7273 pub lon_camera: i32,
7274 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
7275 pub alt_camera: i32,
7276 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7277 pub lat_image: i32,
7278 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7279 pub lon_image: i32,
7280 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7281 pub alt_image: i32,
7282 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7283 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7284 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7285 pub q: [f32; 4],
7286 #[doc = "Horizontal field of view (NaN if unknown)."]
7287 pub hfov: f32,
7288 #[doc = "Vertical field of view (NaN if unknown)."]
7289 pub vfov: f32,
7290 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7291 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7292 pub camera_device_id: u8,
7293}
7294impl CAMERA_FOV_STATUS_DATA {
7295 pub const ENCODED_LEN: usize = 53usize;
7296 pub const DEFAULT: Self = Self {
7297 time_boot_ms: 0_u32,
7298 lat_camera: 0_i32,
7299 lon_camera: 0_i32,
7300 alt_camera: 0_i32,
7301 lat_image: 0_i32,
7302 lon_image: 0_i32,
7303 alt_image: 0_i32,
7304 q: [0.0_f32; 4usize],
7305 hfov: 0.0_f32,
7306 vfov: 0.0_f32,
7307 camera_device_id: 0_u8,
7308 };
7309 #[cfg(feature = "arbitrary")]
7310 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7311 use arbitrary::{Arbitrary, Unstructured};
7312 let mut buf = [0u8; 1024];
7313 rng.fill_bytes(&mut buf);
7314 let mut unstructured = Unstructured::new(&buf);
7315 Self::arbitrary(&mut unstructured).unwrap_or_default()
7316 }
7317}
7318impl Default for CAMERA_FOV_STATUS_DATA {
7319 fn default() -> Self {
7320 Self::DEFAULT.clone()
7321 }
7322}
7323impl MessageData for CAMERA_FOV_STATUS_DATA {
7324 type Message = MavMessage;
7325 const ID: u32 = 271u32;
7326 const NAME: &'static str = "CAMERA_FOV_STATUS";
7327 const EXTRA_CRC: u8 = 22u8;
7328 const ENCODED_LEN: usize = 53usize;
7329 fn deser(
7330 _version: MavlinkVersion,
7331 __input: &[u8],
7332 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7333 let avail_len = __input.len();
7334 let mut payload_buf = [0; Self::ENCODED_LEN];
7335 let mut buf = if avail_len < Self::ENCODED_LEN {
7336 payload_buf[0..avail_len].copy_from_slice(__input);
7337 Bytes::new(&payload_buf)
7338 } else {
7339 Bytes::new(__input)
7340 };
7341 let mut __struct = Self::default();
7342 __struct.time_boot_ms = buf.get_u32_le()?;
7343 __struct.lat_camera = buf.get_i32_le()?;
7344 __struct.lon_camera = buf.get_i32_le()?;
7345 __struct.alt_camera = buf.get_i32_le()?;
7346 __struct.lat_image = buf.get_i32_le()?;
7347 __struct.lon_image = buf.get_i32_le()?;
7348 __struct.alt_image = buf.get_i32_le()?;
7349 for v in &mut __struct.q {
7350 let val = buf.get_f32_le()?;
7351 *v = val;
7352 }
7353 __struct.hfov = buf.get_f32_le()?;
7354 __struct.vfov = buf.get_f32_le()?;
7355 __struct.camera_device_id = buf.get_u8()?;
7356 Ok(__struct)
7357 }
7358 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7359 let mut __tmp = BytesMut::new(bytes);
7360 #[allow(clippy::absurd_extreme_comparisons)]
7361 #[allow(unused_comparisons)]
7362 if __tmp.remaining() < Self::ENCODED_LEN {
7363 panic!(
7364 "buffer is too small (need {} bytes, but got {})",
7365 Self::ENCODED_LEN,
7366 __tmp.remaining(),
7367 )
7368 }
7369 __tmp.put_u32_le(self.time_boot_ms);
7370 __tmp.put_i32_le(self.lat_camera);
7371 __tmp.put_i32_le(self.lon_camera);
7372 __tmp.put_i32_le(self.alt_camera);
7373 __tmp.put_i32_le(self.lat_image);
7374 __tmp.put_i32_le(self.lon_image);
7375 __tmp.put_i32_le(self.alt_image);
7376 for val in &self.q {
7377 __tmp.put_f32_le(*val);
7378 }
7379 __tmp.put_f32_le(self.hfov);
7380 __tmp.put_f32_le(self.vfov);
7381 if matches!(version, MavlinkVersion::V2) {
7382 __tmp.put_u8(self.camera_device_id);
7383 let len = __tmp.len();
7384 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7385 } else {
7386 __tmp.len()
7387 }
7388 }
7389}
7390#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
7391#[doc = ""]
7392#[doc = "ID: 263"]
7393#[derive(Debug, Clone, PartialEq)]
7394#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7395#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7396#[cfg_attr(feature = "ts", derive(TS))]
7397#[cfg_attr(feature = "ts", ts(export))]
7398pub struct CAMERA_IMAGE_CAPTURED_DATA {
7399 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
7400 pub time_utc: u64,
7401 #[doc = "Timestamp (time since system boot)."]
7402 pub time_boot_ms: u32,
7403 #[doc = "Latitude where image was taken"]
7404 pub lat: i32,
7405 #[doc = "Longitude where capture was taken"]
7406 pub lon: i32,
7407 #[doc = "Altitude (MSL) where image was taken"]
7408 pub alt: i32,
7409 #[doc = "Altitude above ground"]
7410 pub relative_alt: i32,
7411 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7412 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7413 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7414 pub q: [f32; 4],
7415 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
7416 pub image_index: i32,
7417 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
7418 pub camera_id: u8,
7419 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
7420 pub capture_result: i8,
7421 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
7422 #[cfg_attr(feature = "ts", ts(type = "string"))]
7423 pub file_url: CharArray<205>,
7424}
7425impl CAMERA_IMAGE_CAPTURED_DATA {
7426 pub const ENCODED_LEN: usize = 255usize;
7427 pub const DEFAULT: Self = Self {
7428 time_utc: 0_u64,
7429 time_boot_ms: 0_u32,
7430 lat: 0_i32,
7431 lon: 0_i32,
7432 alt: 0_i32,
7433 relative_alt: 0_i32,
7434 q: [0.0_f32; 4usize],
7435 image_index: 0_i32,
7436 camera_id: 0_u8,
7437 capture_result: 0_i8,
7438 file_url: CharArray::new([0_u8; 205usize]),
7439 };
7440 #[cfg(feature = "arbitrary")]
7441 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7442 use arbitrary::{Arbitrary, Unstructured};
7443 let mut buf = [0u8; 1024];
7444 rng.fill_bytes(&mut buf);
7445 let mut unstructured = Unstructured::new(&buf);
7446 Self::arbitrary(&mut unstructured).unwrap_or_default()
7447 }
7448}
7449impl Default for CAMERA_IMAGE_CAPTURED_DATA {
7450 fn default() -> Self {
7451 Self::DEFAULT.clone()
7452 }
7453}
7454impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
7455 type Message = MavMessage;
7456 const ID: u32 = 263u32;
7457 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
7458 const EXTRA_CRC: u8 = 133u8;
7459 const ENCODED_LEN: usize = 255usize;
7460 fn deser(
7461 _version: MavlinkVersion,
7462 __input: &[u8],
7463 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7464 let avail_len = __input.len();
7465 let mut payload_buf = [0; Self::ENCODED_LEN];
7466 let mut buf = if avail_len < Self::ENCODED_LEN {
7467 payload_buf[0..avail_len].copy_from_slice(__input);
7468 Bytes::new(&payload_buf)
7469 } else {
7470 Bytes::new(__input)
7471 };
7472 let mut __struct = Self::default();
7473 __struct.time_utc = buf.get_u64_le()?;
7474 __struct.time_boot_ms = buf.get_u32_le()?;
7475 __struct.lat = buf.get_i32_le()?;
7476 __struct.lon = buf.get_i32_le()?;
7477 __struct.alt = buf.get_i32_le()?;
7478 __struct.relative_alt = buf.get_i32_le()?;
7479 for v in &mut __struct.q {
7480 let val = buf.get_f32_le()?;
7481 *v = val;
7482 }
7483 __struct.image_index = buf.get_i32_le()?;
7484 __struct.camera_id = buf.get_u8()?;
7485 __struct.capture_result = buf.get_i8()?;
7486 let mut tmp = [0_u8; 205usize];
7487 for v in &mut tmp {
7488 *v = buf.get_u8()?;
7489 }
7490 __struct.file_url = CharArray::new(tmp);
7491 Ok(__struct)
7492 }
7493 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7494 let mut __tmp = BytesMut::new(bytes);
7495 #[allow(clippy::absurd_extreme_comparisons)]
7496 #[allow(unused_comparisons)]
7497 if __tmp.remaining() < Self::ENCODED_LEN {
7498 panic!(
7499 "buffer is too small (need {} bytes, but got {})",
7500 Self::ENCODED_LEN,
7501 __tmp.remaining(),
7502 )
7503 }
7504 __tmp.put_u64_le(self.time_utc);
7505 __tmp.put_u32_le(self.time_boot_ms);
7506 __tmp.put_i32_le(self.lat);
7507 __tmp.put_i32_le(self.lon);
7508 __tmp.put_i32_le(self.alt);
7509 __tmp.put_i32_le(self.relative_alt);
7510 for val in &self.q {
7511 __tmp.put_f32_le(*val);
7512 }
7513 __tmp.put_i32_le(self.image_index);
7514 __tmp.put_u8(self.camera_id);
7515 __tmp.put_i8(self.capture_result);
7516 for val in &self.file_url {
7517 __tmp.put_u8(*val);
7518 }
7519 if matches!(version, MavlinkVersion::V2) {
7520 let len = __tmp.len();
7521 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7522 } else {
7523 __tmp.len()
7524 }
7525 }
7526}
7527#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7528#[doc = ""]
7529#[doc = "ID: 259"]
7530#[derive(Debug, Clone, PartialEq)]
7531#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7532#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7533#[cfg_attr(feature = "ts", derive(TS))]
7534#[cfg_attr(feature = "ts", ts(export))]
7535pub struct CAMERA_INFORMATION_DATA {
7536 #[doc = "Timestamp (time since system boot)."]
7537 pub time_boot_ms: u32,
7538 #[doc = "0xff). Use 0 if not known."]
7539 pub firmware_version: u32,
7540 #[doc = "Focal length. Use NaN if not known."]
7541 pub focal_length: f32,
7542 #[doc = "Image sensor size horizontal. Use NaN if not known."]
7543 pub sensor_size_h: f32,
7544 #[doc = "Image sensor size vertical. Use NaN if not known."]
7545 pub sensor_size_v: f32,
7546 #[doc = "Bitmap of camera capability flags."]
7547 pub flags: CameraCapFlags,
7548 #[doc = "Horizontal image resolution. Use 0 if not known."]
7549 pub resolution_h: u16,
7550 #[doc = "Vertical image resolution. Use 0 if not known."]
7551 pub resolution_v: u16,
7552 #[doc = "Camera definition version (iteration). Use 0 if not known."]
7553 pub cam_definition_version: u16,
7554 #[doc = "Name of the camera vendor"]
7555 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7556 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7557 pub vendor_name: [u8; 32],
7558 #[doc = "Name of the camera model"]
7559 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7560 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7561 pub model_name: [u8; 32],
7562 #[doc = "Reserved for a lens ID. Use 0 if not known."]
7563 pub lens_id: u8,
7564 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
7565 #[cfg_attr(feature = "ts", ts(type = "string"))]
7566 pub cam_definition_uri: CharArray<140>,
7567 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
7568 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7569 pub gimbal_device_id: u8,
7570 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7571 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7572 pub camera_device_id: u8,
7573}
7574impl CAMERA_INFORMATION_DATA {
7575 pub const ENCODED_LEN: usize = 237usize;
7576 pub const DEFAULT: Self = Self {
7577 time_boot_ms: 0_u32,
7578 firmware_version: 0_u32,
7579 focal_length: 0.0_f32,
7580 sensor_size_h: 0.0_f32,
7581 sensor_size_v: 0.0_f32,
7582 flags: CameraCapFlags::DEFAULT,
7583 resolution_h: 0_u16,
7584 resolution_v: 0_u16,
7585 cam_definition_version: 0_u16,
7586 vendor_name: [0_u8; 32usize],
7587 model_name: [0_u8; 32usize],
7588 lens_id: 0_u8,
7589 cam_definition_uri: CharArray::new([0_u8; 140usize]),
7590 gimbal_device_id: 0_u8,
7591 camera_device_id: 0_u8,
7592 };
7593 #[cfg(feature = "arbitrary")]
7594 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7595 use arbitrary::{Arbitrary, Unstructured};
7596 let mut buf = [0u8; 1024];
7597 rng.fill_bytes(&mut buf);
7598 let mut unstructured = Unstructured::new(&buf);
7599 Self::arbitrary(&mut unstructured).unwrap_or_default()
7600 }
7601}
7602impl Default for CAMERA_INFORMATION_DATA {
7603 fn default() -> Self {
7604 Self::DEFAULT.clone()
7605 }
7606}
7607impl MessageData for CAMERA_INFORMATION_DATA {
7608 type Message = MavMessage;
7609 const ID: u32 = 259u32;
7610 const NAME: &'static str = "CAMERA_INFORMATION";
7611 const EXTRA_CRC: u8 = 92u8;
7612 const ENCODED_LEN: usize = 237usize;
7613 fn deser(
7614 _version: MavlinkVersion,
7615 __input: &[u8],
7616 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7617 let avail_len = __input.len();
7618 let mut payload_buf = [0; Self::ENCODED_LEN];
7619 let mut buf = if avail_len < Self::ENCODED_LEN {
7620 payload_buf[0..avail_len].copy_from_slice(__input);
7621 Bytes::new(&payload_buf)
7622 } else {
7623 Bytes::new(__input)
7624 };
7625 let mut __struct = Self::default();
7626 __struct.time_boot_ms = buf.get_u32_le()?;
7627 __struct.firmware_version = buf.get_u32_le()?;
7628 __struct.focal_length = buf.get_f32_le()?;
7629 __struct.sensor_size_h = buf.get_f32_le()?;
7630 __struct.sensor_size_v = buf.get_f32_le()?;
7631 let tmp = buf.get_u32_le()?;
7632 __struct.flags = CameraCapFlags::from_bits(tmp as <CameraCapFlags as Flags>::Bits).ok_or(
7633 ::mavlink_core::error::ParserError::InvalidFlag {
7634 flag_type: "CameraCapFlags",
7635 value: tmp as u64,
7636 },
7637 )?;
7638 __struct.resolution_h = buf.get_u16_le()?;
7639 __struct.resolution_v = buf.get_u16_le()?;
7640 __struct.cam_definition_version = buf.get_u16_le()?;
7641 for v in &mut __struct.vendor_name {
7642 let val = buf.get_u8()?;
7643 *v = val;
7644 }
7645 for v in &mut __struct.model_name {
7646 let val = buf.get_u8()?;
7647 *v = val;
7648 }
7649 __struct.lens_id = buf.get_u8()?;
7650 let mut tmp = [0_u8; 140usize];
7651 for v in &mut tmp {
7652 *v = buf.get_u8()?;
7653 }
7654 __struct.cam_definition_uri = CharArray::new(tmp);
7655 __struct.gimbal_device_id = buf.get_u8()?;
7656 __struct.camera_device_id = buf.get_u8()?;
7657 Ok(__struct)
7658 }
7659 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7660 let mut __tmp = BytesMut::new(bytes);
7661 #[allow(clippy::absurd_extreme_comparisons)]
7662 #[allow(unused_comparisons)]
7663 if __tmp.remaining() < Self::ENCODED_LEN {
7664 panic!(
7665 "buffer is too small (need {} bytes, but got {})",
7666 Self::ENCODED_LEN,
7667 __tmp.remaining(),
7668 )
7669 }
7670 __tmp.put_u32_le(self.time_boot_ms);
7671 __tmp.put_u32_le(self.firmware_version);
7672 __tmp.put_f32_le(self.focal_length);
7673 __tmp.put_f32_le(self.sensor_size_h);
7674 __tmp.put_f32_le(self.sensor_size_v);
7675 __tmp.put_u32_le(self.flags.bits() as u32);
7676 __tmp.put_u16_le(self.resolution_h);
7677 __tmp.put_u16_le(self.resolution_v);
7678 __tmp.put_u16_le(self.cam_definition_version);
7679 for val in &self.vendor_name {
7680 __tmp.put_u8(*val);
7681 }
7682 for val in &self.model_name {
7683 __tmp.put_u8(*val);
7684 }
7685 __tmp.put_u8(self.lens_id);
7686 for val in &self.cam_definition_uri {
7687 __tmp.put_u8(*val);
7688 }
7689 if matches!(version, MavlinkVersion::V2) {
7690 __tmp.put_u8(self.gimbal_device_id);
7691 __tmp.put_u8(self.camera_device_id);
7692 let len = __tmp.len();
7693 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7694 } else {
7695 __tmp.len()
7696 }
7697 }
7698}
7699#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7700#[doc = ""]
7701#[doc = "ID: 260"]
7702#[derive(Debug, Clone, PartialEq)]
7703#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7704#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7705#[cfg_attr(feature = "ts", derive(TS))]
7706#[cfg_attr(feature = "ts", ts(export))]
7707pub struct CAMERA_SETTINGS_DATA {
7708 #[doc = "Timestamp (time since system boot)."]
7709 pub time_boot_ms: u32,
7710 #[doc = "Camera mode"]
7711 pub mode_id: CameraMode,
7712 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7713 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7714 pub zoomLevel: f32,
7715 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7716 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7717 pub focusLevel: f32,
7718 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7719 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7720 pub camera_device_id: u8,
7721}
7722impl CAMERA_SETTINGS_DATA {
7723 pub const ENCODED_LEN: usize = 14usize;
7724 pub const DEFAULT: Self = Self {
7725 time_boot_ms: 0_u32,
7726 mode_id: CameraMode::DEFAULT,
7727 zoomLevel: 0.0_f32,
7728 focusLevel: 0.0_f32,
7729 camera_device_id: 0_u8,
7730 };
7731 #[cfg(feature = "arbitrary")]
7732 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7733 use arbitrary::{Arbitrary, Unstructured};
7734 let mut buf = [0u8; 1024];
7735 rng.fill_bytes(&mut buf);
7736 let mut unstructured = Unstructured::new(&buf);
7737 Self::arbitrary(&mut unstructured).unwrap_or_default()
7738 }
7739}
7740impl Default for CAMERA_SETTINGS_DATA {
7741 fn default() -> Self {
7742 Self::DEFAULT.clone()
7743 }
7744}
7745impl MessageData for CAMERA_SETTINGS_DATA {
7746 type Message = MavMessage;
7747 const ID: u32 = 260u32;
7748 const NAME: &'static str = "CAMERA_SETTINGS";
7749 const EXTRA_CRC: u8 = 146u8;
7750 const ENCODED_LEN: usize = 14usize;
7751 fn deser(
7752 _version: MavlinkVersion,
7753 __input: &[u8],
7754 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7755 let avail_len = __input.len();
7756 let mut payload_buf = [0; Self::ENCODED_LEN];
7757 let mut buf = if avail_len < Self::ENCODED_LEN {
7758 payload_buf[0..avail_len].copy_from_slice(__input);
7759 Bytes::new(&payload_buf)
7760 } else {
7761 Bytes::new(__input)
7762 };
7763 let mut __struct = Self::default();
7764 __struct.time_boot_ms = buf.get_u32_le()?;
7765 let tmp = buf.get_u8()?;
7766 __struct.mode_id =
7767 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7768 enum_type: "CameraMode",
7769 value: tmp as u64,
7770 })?;
7771 __struct.zoomLevel = buf.get_f32_le()?;
7772 __struct.focusLevel = buf.get_f32_le()?;
7773 __struct.camera_device_id = buf.get_u8()?;
7774 Ok(__struct)
7775 }
7776 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7777 let mut __tmp = BytesMut::new(bytes);
7778 #[allow(clippy::absurd_extreme_comparisons)]
7779 #[allow(unused_comparisons)]
7780 if __tmp.remaining() < Self::ENCODED_LEN {
7781 panic!(
7782 "buffer is too small (need {} bytes, but got {})",
7783 Self::ENCODED_LEN,
7784 __tmp.remaining(),
7785 )
7786 }
7787 __tmp.put_u32_le(self.time_boot_ms);
7788 __tmp.put_u8(self.mode_id as u8);
7789 if matches!(version, MavlinkVersion::V2) {
7790 __tmp.put_f32_le(self.zoomLevel);
7791 __tmp.put_f32_le(self.focusLevel);
7792 __tmp.put_u8(self.camera_device_id);
7793 let len = __tmp.len();
7794 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7795 } else {
7796 __tmp.len()
7797 }
7798 }
7799}
7800#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
7801#[doc = ""]
7802#[doc = "ID: 277"]
7803#[derive(Debug, Clone, PartialEq)]
7804#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7805#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7806#[cfg_attr(feature = "ts", derive(TS))]
7807#[cfg_attr(feature = "ts", ts(export))]
7808pub struct CAMERA_THERMAL_RANGE_DATA {
7809 #[doc = "Timestamp (time since system boot)."]
7810 pub time_boot_ms: u32,
7811 #[doc = "Temperature max."]
7812 pub max: f32,
7813 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7814 pub max_point_x: f32,
7815 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7816 pub max_point_y: f32,
7817 #[doc = "Temperature min."]
7818 pub min: f32,
7819 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7820 pub min_point_x: f32,
7821 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7822 pub min_point_y: f32,
7823 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
7824 pub stream_id: u8,
7825 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7826 pub camera_device_id: u8,
7827}
7828impl CAMERA_THERMAL_RANGE_DATA {
7829 pub const ENCODED_LEN: usize = 30usize;
7830 pub const DEFAULT: Self = Self {
7831 time_boot_ms: 0_u32,
7832 max: 0.0_f32,
7833 max_point_x: 0.0_f32,
7834 max_point_y: 0.0_f32,
7835 min: 0.0_f32,
7836 min_point_x: 0.0_f32,
7837 min_point_y: 0.0_f32,
7838 stream_id: 0_u8,
7839 camera_device_id: 0_u8,
7840 };
7841 #[cfg(feature = "arbitrary")]
7842 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7843 use arbitrary::{Arbitrary, Unstructured};
7844 let mut buf = [0u8; 1024];
7845 rng.fill_bytes(&mut buf);
7846 let mut unstructured = Unstructured::new(&buf);
7847 Self::arbitrary(&mut unstructured).unwrap_or_default()
7848 }
7849}
7850impl Default for CAMERA_THERMAL_RANGE_DATA {
7851 fn default() -> Self {
7852 Self::DEFAULT.clone()
7853 }
7854}
7855impl MessageData for CAMERA_THERMAL_RANGE_DATA {
7856 type Message = MavMessage;
7857 const ID: u32 = 277u32;
7858 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
7859 const EXTRA_CRC: u8 = 62u8;
7860 const ENCODED_LEN: usize = 30usize;
7861 fn deser(
7862 _version: MavlinkVersion,
7863 __input: &[u8],
7864 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7865 let avail_len = __input.len();
7866 let mut payload_buf = [0; Self::ENCODED_LEN];
7867 let mut buf = if avail_len < Self::ENCODED_LEN {
7868 payload_buf[0..avail_len].copy_from_slice(__input);
7869 Bytes::new(&payload_buf)
7870 } else {
7871 Bytes::new(__input)
7872 };
7873 let mut __struct = Self::default();
7874 __struct.time_boot_ms = buf.get_u32_le()?;
7875 __struct.max = buf.get_f32_le()?;
7876 __struct.max_point_x = buf.get_f32_le()?;
7877 __struct.max_point_y = buf.get_f32_le()?;
7878 __struct.min = buf.get_f32_le()?;
7879 __struct.min_point_x = buf.get_f32_le()?;
7880 __struct.min_point_y = buf.get_f32_le()?;
7881 __struct.stream_id = buf.get_u8()?;
7882 __struct.camera_device_id = buf.get_u8()?;
7883 Ok(__struct)
7884 }
7885 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7886 let mut __tmp = BytesMut::new(bytes);
7887 #[allow(clippy::absurd_extreme_comparisons)]
7888 #[allow(unused_comparisons)]
7889 if __tmp.remaining() < Self::ENCODED_LEN {
7890 panic!(
7891 "buffer is too small (need {} bytes, but got {})",
7892 Self::ENCODED_LEN,
7893 __tmp.remaining(),
7894 )
7895 }
7896 __tmp.put_u32_le(self.time_boot_ms);
7897 __tmp.put_f32_le(self.max);
7898 __tmp.put_f32_le(self.max_point_x);
7899 __tmp.put_f32_le(self.max_point_y);
7900 __tmp.put_f32_le(self.min);
7901 __tmp.put_f32_le(self.min_point_x);
7902 __tmp.put_f32_le(self.min_point_y);
7903 __tmp.put_u8(self.stream_id);
7904 __tmp.put_u8(self.camera_device_id);
7905 if matches!(version, MavlinkVersion::V2) {
7906 let len = __tmp.len();
7907 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7908 } else {
7909 __tmp.len()
7910 }
7911 }
7912}
7913#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7914#[doc = ""]
7915#[doc = "ID: 276"]
7916#[derive(Debug, Clone, PartialEq)]
7917#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7918#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7919#[cfg_attr(feature = "ts", derive(TS))]
7920#[cfg_attr(feature = "ts", ts(export))]
7921pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
7922 #[doc = "Latitude of tracked object"]
7923 pub lat: i32,
7924 #[doc = "Longitude of tracked object"]
7925 pub lon: i32,
7926 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
7927 pub alt: f32,
7928 #[doc = "Horizontal accuracy. NAN if unknown"]
7929 pub h_acc: f32,
7930 #[doc = "Vertical accuracy. NAN if unknown"]
7931 pub v_acc: f32,
7932 #[doc = "North velocity of tracked object. NAN if unknown"]
7933 pub vel_n: f32,
7934 #[doc = "East velocity of tracked object. NAN if unknown"]
7935 pub vel_e: f32,
7936 #[doc = "Down velocity of tracked object. NAN if unknown"]
7937 pub vel_d: f32,
7938 #[doc = "Velocity accuracy. NAN if unknown"]
7939 pub vel_acc: f32,
7940 #[doc = "Distance between camera and tracked object. NAN if unknown"]
7941 pub dist: f32,
7942 #[doc = "Heading in radians, in NED. NAN if unknown"]
7943 pub hdg: f32,
7944 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
7945 pub hdg_acc: f32,
7946 #[doc = "Current tracking status"]
7947 pub tracking_status: CameraTrackingStatusFlags,
7948 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7949 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7950 pub camera_device_id: u8,
7951}
7952impl CAMERA_TRACKING_GEO_STATUS_DATA {
7953 pub const ENCODED_LEN: usize = 50usize;
7954 pub const DEFAULT: Self = Self {
7955 lat: 0_i32,
7956 lon: 0_i32,
7957 alt: 0.0_f32,
7958 h_acc: 0.0_f32,
7959 v_acc: 0.0_f32,
7960 vel_n: 0.0_f32,
7961 vel_e: 0.0_f32,
7962 vel_d: 0.0_f32,
7963 vel_acc: 0.0_f32,
7964 dist: 0.0_f32,
7965 hdg: 0.0_f32,
7966 hdg_acc: 0.0_f32,
7967 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7968 camera_device_id: 0_u8,
7969 };
7970 #[cfg(feature = "arbitrary")]
7971 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7972 use arbitrary::{Arbitrary, Unstructured};
7973 let mut buf = [0u8; 1024];
7974 rng.fill_bytes(&mut buf);
7975 let mut unstructured = Unstructured::new(&buf);
7976 Self::arbitrary(&mut unstructured).unwrap_or_default()
7977 }
7978}
7979impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
7980 fn default() -> Self {
7981 Self::DEFAULT.clone()
7982 }
7983}
7984impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
7985 type Message = MavMessage;
7986 const ID: u32 = 276u32;
7987 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
7988 const EXTRA_CRC: u8 = 18u8;
7989 const ENCODED_LEN: usize = 50usize;
7990 fn deser(
7991 _version: MavlinkVersion,
7992 __input: &[u8],
7993 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7994 let avail_len = __input.len();
7995 let mut payload_buf = [0; Self::ENCODED_LEN];
7996 let mut buf = if avail_len < Self::ENCODED_LEN {
7997 payload_buf[0..avail_len].copy_from_slice(__input);
7998 Bytes::new(&payload_buf)
7999 } else {
8000 Bytes::new(__input)
8001 };
8002 let mut __struct = Self::default();
8003 __struct.lat = buf.get_i32_le()?;
8004 __struct.lon = buf.get_i32_le()?;
8005 __struct.alt = buf.get_f32_le()?;
8006 __struct.h_acc = buf.get_f32_le()?;
8007 __struct.v_acc = buf.get_f32_le()?;
8008 __struct.vel_n = buf.get_f32_le()?;
8009 __struct.vel_e = buf.get_f32_le()?;
8010 __struct.vel_d = buf.get_f32_le()?;
8011 __struct.vel_acc = buf.get_f32_le()?;
8012 __struct.dist = buf.get_f32_le()?;
8013 __struct.hdg = buf.get_f32_le()?;
8014 __struct.hdg_acc = buf.get_f32_le()?;
8015 let tmp = buf.get_u8()?;
8016 __struct.tracking_status =
8017 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8018 enum_type: "CameraTrackingStatusFlags",
8019 value: tmp as u64,
8020 })?;
8021 __struct.camera_device_id = buf.get_u8()?;
8022 Ok(__struct)
8023 }
8024 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8025 let mut __tmp = BytesMut::new(bytes);
8026 #[allow(clippy::absurd_extreme_comparisons)]
8027 #[allow(unused_comparisons)]
8028 if __tmp.remaining() < Self::ENCODED_LEN {
8029 panic!(
8030 "buffer is too small (need {} bytes, but got {})",
8031 Self::ENCODED_LEN,
8032 __tmp.remaining(),
8033 )
8034 }
8035 __tmp.put_i32_le(self.lat);
8036 __tmp.put_i32_le(self.lon);
8037 __tmp.put_f32_le(self.alt);
8038 __tmp.put_f32_le(self.h_acc);
8039 __tmp.put_f32_le(self.v_acc);
8040 __tmp.put_f32_le(self.vel_n);
8041 __tmp.put_f32_le(self.vel_e);
8042 __tmp.put_f32_le(self.vel_d);
8043 __tmp.put_f32_le(self.vel_acc);
8044 __tmp.put_f32_le(self.dist);
8045 __tmp.put_f32_le(self.hdg);
8046 __tmp.put_f32_le(self.hdg_acc);
8047 __tmp.put_u8(self.tracking_status as u8);
8048 if matches!(version, MavlinkVersion::V2) {
8049 __tmp.put_u8(self.camera_device_id);
8050 let len = __tmp.len();
8051 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8052 } else {
8053 __tmp.len()
8054 }
8055 }
8056}
8057#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
8058#[doc = ""]
8059#[doc = "ID: 275"]
8060#[derive(Debug, Clone, PartialEq)]
8061#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8062#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8063#[cfg_attr(feature = "ts", derive(TS))]
8064#[cfg_attr(feature = "ts", ts(export))]
8065pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
8066 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8067 pub point_x: f32,
8068 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8069 pub point_y: f32,
8070 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
8071 pub radius: f32,
8072 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8073 pub rec_top_x: f32,
8074 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8075 pub rec_top_y: f32,
8076 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8077 pub rec_bottom_x: f32,
8078 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8079 pub rec_bottom_y: f32,
8080 #[doc = "Current tracking status"]
8081 pub tracking_status: CameraTrackingStatusFlags,
8082 #[doc = "Current tracking mode"]
8083 pub tracking_mode: CameraTrackingMode,
8084 #[doc = "Defines location of target data"]
8085 pub target_data: CameraTrackingTargetData,
8086 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8087 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8088 pub camera_device_id: u8,
8089}
8090impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
8091 pub const ENCODED_LEN: usize = 32usize;
8092 pub const DEFAULT: Self = Self {
8093 point_x: 0.0_f32,
8094 point_y: 0.0_f32,
8095 radius: 0.0_f32,
8096 rec_top_x: 0.0_f32,
8097 rec_top_y: 0.0_f32,
8098 rec_bottom_x: 0.0_f32,
8099 rec_bottom_y: 0.0_f32,
8100 tracking_status: CameraTrackingStatusFlags::DEFAULT,
8101 tracking_mode: CameraTrackingMode::DEFAULT,
8102 target_data: CameraTrackingTargetData::DEFAULT,
8103 camera_device_id: 0_u8,
8104 };
8105 #[cfg(feature = "arbitrary")]
8106 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8107 use arbitrary::{Arbitrary, Unstructured};
8108 let mut buf = [0u8; 1024];
8109 rng.fill_bytes(&mut buf);
8110 let mut unstructured = Unstructured::new(&buf);
8111 Self::arbitrary(&mut unstructured).unwrap_or_default()
8112 }
8113}
8114impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
8115 fn default() -> Self {
8116 Self::DEFAULT.clone()
8117 }
8118}
8119impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
8120 type Message = MavMessage;
8121 const ID: u32 = 275u32;
8122 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
8123 const EXTRA_CRC: u8 = 126u8;
8124 const ENCODED_LEN: usize = 32usize;
8125 fn deser(
8126 _version: MavlinkVersion,
8127 __input: &[u8],
8128 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8129 let avail_len = __input.len();
8130 let mut payload_buf = [0; Self::ENCODED_LEN];
8131 let mut buf = if avail_len < Self::ENCODED_LEN {
8132 payload_buf[0..avail_len].copy_from_slice(__input);
8133 Bytes::new(&payload_buf)
8134 } else {
8135 Bytes::new(__input)
8136 };
8137 let mut __struct = Self::default();
8138 __struct.point_x = buf.get_f32_le()?;
8139 __struct.point_y = buf.get_f32_le()?;
8140 __struct.radius = buf.get_f32_le()?;
8141 __struct.rec_top_x = buf.get_f32_le()?;
8142 __struct.rec_top_y = buf.get_f32_le()?;
8143 __struct.rec_bottom_x = buf.get_f32_le()?;
8144 __struct.rec_bottom_y = buf.get_f32_le()?;
8145 let tmp = buf.get_u8()?;
8146 __struct.tracking_status =
8147 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8148 enum_type: "CameraTrackingStatusFlags",
8149 value: tmp as u64,
8150 })?;
8151 let tmp = buf.get_u8()?;
8152 __struct.tracking_mode =
8153 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8154 enum_type: "CameraTrackingMode",
8155 value: tmp as u64,
8156 })?;
8157 let tmp = buf.get_u8()?;
8158 __struct.target_data =
8159 CameraTrackingTargetData::from_bits(tmp as <CameraTrackingTargetData as Flags>::Bits)
8160 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
8161 flag_type: "CameraTrackingTargetData",
8162 value: tmp as u64,
8163 })?;
8164 __struct.camera_device_id = buf.get_u8()?;
8165 Ok(__struct)
8166 }
8167 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8168 let mut __tmp = BytesMut::new(bytes);
8169 #[allow(clippy::absurd_extreme_comparisons)]
8170 #[allow(unused_comparisons)]
8171 if __tmp.remaining() < Self::ENCODED_LEN {
8172 panic!(
8173 "buffer is too small (need {} bytes, but got {})",
8174 Self::ENCODED_LEN,
8175 __tmp.remaining(),
8176 )
8177 }
8178 __tmp.put_f32_le(self.point_x);
8179 __tmp.put_f32_le(self.point_y);
8180 __tmp.put_f32_le(self.radius);
8181 __tmp.put_f32_le(self.rec_top_x);
8182 __tmp.put_f32_le(self.rec_top_y);
8183 __tmp.put_f32_le(self.rec_bottom_x);
8184 __tmp.put_f32_le(self.rec_bottom_y);
8185 __tmp.put_u8(self.tracking_status as u8);
8186 __tmp.put_u8(self.tracking_mode as u8);
8187 __tmp.put_u8(self.target_data.bits() as u8);
8188 if matches!(version, MavlinkVersion::V2) {
8189 __tmp.put_u8(self.camera_device_id);
8190 let len = __tmp.len();
8191 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8192 } else {
8193 __tmp.len()
8194 }
8195 }
8196}
8197#[doc = "Camera-IMU triggering and synchronisation message."]
8198#[doc = ""]
8199#[doc = "ID: 112"]
8200#[derive(Debug, Clone, PartialEq)]
8201#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8202#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8203#[cfg_attr(feature = "ts", derive(TS))]
8204#[cfg_attr(feature = "ts", ts(export))]
8205pub struct CAMERA_TRIGGER_DATA {
8206 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
8207 pub time_usec: u64,
8208 #[doc = "Image frame sequence"]
8209 pub seq: u32,
8210}
8211impl CAMERA_TRIGGER_DATA {
8212 pub const ENCODED_LEN: usize = 12usize;
8213 pub const DEFAULT: Self = Self {
8214 time_usec: 0_u64,
8215 seq: 0_u32,
8216 };
8217 #[cfg(feature = "arbitrary")]
8218 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8219 use arbitrary::{Arbitrary, Unstructured};
8220 let mut buf = [0u8; 1024];
8221 rng.fill_bytes(&mut buf);
8222 let mut unstructured = Unstructured::new(&buf);
8223 Self::arbitrary(&mut unstructured).unwrap_or_default()
8224 }
8225}
8226impl Default for CAMERA_TRIGGER_DATA {
8227 fn default() -> Self {
8228 Self::DEFAULT.clone()
8229 }
8230}
8231impl MessageData for CAMERA_TRIGGER_DATA {
8232 type Message = MavMessage;
8233 const ID: u32 = 112u32;
8234 const NAME: &'static str = "CAMERA_TRIGGER";
8235 const EXTRA_CRC: u8 = 174u8;
8236 const ENCODED_LEN: usize = 12usize;
8237 fn deser(
8238 _version: MavlinkVersion,
8239 __input: &[u8],
8240 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8241 let avail_len = __input.len();
8242 let mut payload_buf = [0; Self::ENCODED_LEN];
8243 let mut buf = if avail_len < Self::ENCODED_LEN {
8244 payload_buf[0..avail_len].copy_from_slice(__input);
8245 Bytes::new(&payload_buf)
8246 } else {
8247 Bytes::new(__input)
8248 };
8249 let mut __struct = Self::default();
8250 __struct.time_usec = buf.get_u64_le()?;
8251 __struct.seq = buf.get_u32_le()?;
8252 Ok(__struct)
8253 }
8254 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8255 let mut __tmp = BytesMut::new(bytes);
8256 #[allow(clippy::absurd_extreme_comparisons)]
8257 #[allow(unused_comparisons)]
8258 if __tmp.remaining() < Self::ENCODED_LEN {
8259 panic!(
8260 "buffer is too small (need {} bytes, but got {})",
8261 Self::ENCODED_LEN,
8262 __tmp.remaining(),
8263 )
8264 }
8265 __tmp.put_u64_le(self.time_usec);
8266 __tmp.put_u32_le(self.seq);
8267 if matches!(version, MavlinkVersion::V2) {
8268 let len = __tmp.len();
8269 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8270 } else {
8271 __tmp.len()
8272 }
8273 }
8274}
8275#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
8276#[doc = ""]
8277#[doc = "ID: 387"]
8278#[derive(Debug, Clone, PartialEq)]
8279#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8280#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8281#[cfg_attr(feature = "ts", derive(TS))]
8282#[cfg_attr(feature = "ts", ts(export))]
8283pub struct CANFD_FRAME_DATA {
8284 #[doc = "Frame ID"]
8285 pub id: u32,
8286 #[doc = "System ID."]
8287 pub target_system: u8,
8288 #[doc = "Component ID."]
8289 pub target_component: u8,
8290 #[doc = "bus number"]
8291 pub bus: u8,
8292 #[doc = "Frame length"]
8293 pub len: u8,
8294 #[doc = "Frame data"]
8295 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8296 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8297 pub data: [u8; 64],
8298}
8299impl CANFD_FRAME_DATA {
8300 pub const ENCODED_LEN: usize = 72usize;
8301 pub const DEFAULT: Self = Self {
8302 id: 0_u32,
8303 target_system: 0_u8,
8304 target_component: 0_u8,
8305 bus: 0_u8,
8306 len: 0_u8,
8307 data: [0_u8; 64usize],
8308 };
8309 #[cfg(feature = "arbitrary")]
8310 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8311 use arbitrary::{Arbitrary, Unstructured};
8312 let mut buf = [0u8; 1024];
8313 rng.fill_bytes(&mut buf);
8314 let mut unstructured = Unstructured::new(&buf);
8315 Self::arbitrary(&mut unstructured).unwrap_or_default()
8316 }
8317}
8318impl Default for CANFD_FRAME_DATA {
8319 fn default() -> Self {
8320 Self::DEFAULT.clone()
8321 }
8322}
8323impl MessageData for CANFD_FRAME_DATA {
8324 type Message = MavMessage;
8325 const ID: u32 = 387u32;
8326 const NAME: &'static str = "CANFD_FRAME";
8327 const EXTRA_CRC: u8 = 4u8;
8328 const ENCODED_LEN: usize = 72usize;
8329 fn deser(
8330 _version: MavlinkVersion,
8331 __input: &[u8],
8332 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8333 let avail_len = __input.len();
8334 let mut payload_buf = [0; Self::ENCODED_LEN];
8335 let mut buf = if avail_len < Self::ENCODED_LEN {
8336 payload_buf[0..avail_len].copy_from_slice(__input);
8337 Bytes::new(&payload_buf)
8338 } else {
8339 Bytes::new(__input)
8340 };
8341 let mut __struct = Self::default();
8342 __struct.id = buf.get_u32_le()?;
8343 __struct.target_system = buf.get_u8()?;
8344 __struct.target_component = buf.get_u8()?;
8345 __struct.bus = buf.get_u8()?;
8346 __struct.len = buf.get_u8()?;
8347 for v in &mut __struct.data {
8348 let val = buf.get_u8()?;
8349 *v = val;
8350 }
8351 Ok(__struct)
8352 }
8353 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8354 let mut __tmp = BytesMut::new(bytes);
8355 #[allow(clippy::absurd_extreme_comparisons)]
8356 #[allow(unused_comparisons)]
8357 if __tmp.remaining() < Self::ENCODED_LEN {
8358 panic!(
8359 "buffer is too small (need {} bytes, but got {})",
8360 Self::ENCODED_LEN,
8361 __tmp.remaining(),
8362 )
8363 }
8364 __tmp.put_u32_le(self.id);
8365 __tmp.put_u8(self.target_system);
8366 __tmp.put_u8(self.target_component);
8367 __tmp.put_u8(self.bus);
8368 __tmp.put_u8(self.len);
8369 for val in &self.data {
8370 __tmp.put_u8(*val);
8371 }
8372 if matches!(version, MavlinkVersion::V2) {
8373 let len = __tmp.len();
8374 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8375 } else {
8376 __tmp.len()
8377 }
8378 }
8379}
8380#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
8381#[doc = ""]
8382#[doc = "ID: 388"]
8383#[derive(Debug, Clone, PartialEq)]
8384#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8385#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8386#[cfg_attr(feature = "ts", derive(TS))]
8387#[cfg_attr(feature = "ts", ts(export))]
8388pub struct CAN_FILTER_MODIFY_DATA {
8389 #[doc = "filter IDs, length num_ids"]
8390 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8391 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8392 pub ids: [u16; 16],
8393 #[doc = "System ID."]
8394 pub target_system: u8,
8395 #[doc = "Component ID."]
8396 pub target_component: u8,
8397 #[doc = "bus number"]
8398 pub bus: u8,
8399 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
8400 pub operation: CanFilterOp,
8401 #[doc = "number of IDs in filter list"]
8402 pub num_ids: u8,
8403}
8404impl CAN_FILTER_MODIFY_DATA {
8405 pub const ENCODED_LEN: usize = 37usize;
8406 pub const DEFAULT: Self = Self {
8407 ids: [0_u16; 16usize],
8408 target_system: 0_u8,
8409 target_component: 0_u8,
8410 bus: 0_u8,
8411 operation: CanFilterOp::DEFAULT,
8412 num_ids: 0_u8,
8413 };
8414 #[cfg(feature = "arbitrary")]
8415 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8416 use arbitrary::{Arbitrary, Unstructured};
8417 let mut buf = [0u8; 1024];
8418 rng.fill_bytes(&mut buf);
8419 let mut unstructured = Unstructured::new(&buf);
8420 Self::arbitrary(&mut unstructured).unwrap_or_default()
8421 }
8422}
8423impl Default for CAN_FILTER_MODIFY_DATA {
8424 fn default() -> Self {
8425 Self::DEFAULT.clone()
8426 }
8427}
8428impl MessageData for CAN_FILTER_MODIFY_DATA {
8429 type Message = MavMessage;
8430 const ID: u32 = 388u32;
8431 const NAME: &'static str = "CAN_FILTER_MODIFY";
8432 const EXTRA_CRC: u8 = 8u8;
8433 const ENCODED_LEN: usize = 37usize;
8434 fn deser(
8435 _version: MavlinkVersion,
8436 __input: &[u8],
8437 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8438 let avail_len = __input.len();
8439 let mut payload_buf = [0; Self::ENCODED_LEN];
8440 let mut buf = if avail_len < Self::ENCODED_LEN {
8441 payload_buf[0..avail_len].copy_from_slice(__input);
8442 Bytes::new(&payload_buf)
8443 } else {
8444 Bytes::new(__input)
8445 };
8446 let mut __struct = Self::default();
8447 for v in &mut __struct.ids {
8448 let val = buf.get_u16_le()?;
8449 *v = val;
8450 }
8451 __struct.target_system = buf.get_u8()?;
8452 __struct.target_component = buf.get_u8()?;
8453 __struct.bus = buf.get_u8()?;
8454 let tmp = buf.get_u8()?;
8455 __struct.operation =
8456 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8457 enum_type: "CanFilterOp",
8458 value: tmp as u64,
8459 })?;
8460 __struct.num_ids = buf.get_u8()?;
8461 Ok(__struct)
8462 }
8463 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8464 let mut __tmp = BytesMut::new(bytes);
8465 #[allow(clippy::absurd_extreme_comparisons)]
8466 #[allow(unused_comparisons)]
8467 if __tmp.remaining() < Self::ENCODED_LEN {
8468 panic!(
8469 "buffer is too small (need {} bytes, but got {})",
8470 Self::ENCODED_LEN,
8471 __tmp.remaining(),
8472 )
8473 }
8474 for val in &self.ids {
8475 __tmp.put_u16_le(*val);
8476 }
8477 __tmp.put_u8(self.target_system);
8478 __tmp.put_u8(self.target_component);
8479 __tmp.put_u8(self.bus);
8480 __tmp.put_u8(self.operation as u8);
8481 __tmp.put_u8(self.num_ids);
8482 if matches!(version, MavlinkVersion::V2) {
8483 let len = __tmp.len();
8484 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8485 } else {
8486 __tmp.len()
8487 }
8488 }
8489}
8490#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
8491#[doc = ""]
8492#[doc = "ID: 386"]
8493#[derive(Debug, Clone, PartialEq)]
8494#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8495#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8496#[cfg_attr(feature = "ts", derive(TS))]
8497#[cfg_attr(feature = "ts", ts(export))]
8498pub struct CAN_FRAME_DATA {
8499 #[doc = "Frame ID"]
8500 pub id: u32,
8501 #[doc = "System ID."]
8502 pub target_system: u8,
8503 #[doc = "Component ID."]
8504 pub target_component: u8,
8505 #[doc = "Bus number"]
8506 pub bus: u8,
8507 #[doc = "Frame length"]
8508 pub len: u8,
8509 #[doc = "Frame data"]
8510 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8511 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8512 pub data: [u8; 8],
8513}
8514impl CAN_FRAME_DATA {
8515 pub const ENCODED_LEN: usize = 16usize;
8516 pub const DEFAULT: Self = Self {
8517 id: 0_u32,
8518 target_system: 0_u8,
8519 target_component: 0_u8,
8520 bus: 0_u8,
8521 len: 0_u8,
8522 data: [0_u8; 8usize],
8523 };
8524 #[cfg(feature = "arbitrary")]
8525 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8526 use arbitrary::{Arbitrary, Unstructured};
8527 let mut buf = [0u8; 1024];
8528 rng.fill_bytes(&mut buf);
8529 let mut unstructured = Unstructured::new(&buf);
8530 Self::arbitrary(&mut unstructured).unwrap_or_default()
8531 }
8532}
8533impl Default for CAN_FRAME_DATA {
8534 fn default() -> Self {
8535 Self::DEFAULT.clone()
8536 }
8537}
8538impl MessageData for CAN_FRAME_DATA {
8539 type Message = MavMessage;
8540 const ID: u32 = 386u32;
8541 const NAME: &'static str = "CAN_FRAME";
8542 const EXTRA_CRC: u8 = 132u8;
8543 const ENCODED_LEN: usize = 16usize;
8544 fn deser(
8545 _version: MavlinkVersion,
8546 __input: &[u8],
8547 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8548 let avail_len = __input.len();
8549 let mut payload_buf = [0; Self::ENCODED_LEN];
8550 let mut buf = if avail_len < Self::ENCODED_LEN {
8551 payload_buf[0..avail_len].copy_from_slice(__input);
8552 Bytes::new(&payload_buf)
8553 } else {
8554 Bytes::new(__input)
8555 };
8556 let mut __struct = Self::default();
8557 __struct.id = buf.get_u32_le()?;
8558 __struct.target_system = buf.get_u8()?;
8559 __struct.target_component = buf.get_u8()?;
8560 __struct.bus = buf.get_u8()?;
8561 __struct.len = buf.get_u8()?;
8562 for v in &mut __struct.data {
8563 let val = buf.get_u8()?;
8564 *v = val;
8565 }
8566 Ok(__struct)
8567 }
8568 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8569 let mut __tmp = BytesMut::new(bytes);
8570 #[allow(clippy::absurd_extreme_comparisons)]
8571 #[allow(unused_comparisons)]
8572 if __tmp.remaining() < Self::ENCODED_LEN {
8573 panic!(
8574 "buffer is too small (need {} bytes, but got {})",
8575 Self::ENCODED_LEN,
8576 __tmp.remaining(),
8577 )
8578 }
8579 __tmp.put_u32_le(self.id);
8580 __tmp.put_u8(self.target_system);
8581 __tmp.put_u8(self.target_component);
8582 __tmp.put_u8(self.bus);
8583 __tmp.put_u8(self.len);
8584 for val in &self.data {
8585 __tmp.put_u8(*val);
8586 }
8587 if matches!(version, MavlinkVersion::V2) {
8588 let len = __tmp.len();
8589 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8590 } else {
8591 __tmp.len()
8592 }
8593 }
8594}
8595#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
8596#[doc = ""]
8597#[doc = "ID: 336"]
8598#[derive(Debug, Clone, PartialEq)]
8599#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8600#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8601#[cfg_attr(feature = "ts", derive(TS))]
8602#[cfg_attr(feature = "ts", ts(export))]
8603pub struct CELLULAR_CONFIG_DATA {
8604 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8605 pub enable_lte: u8,
8606 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8607 pub enable_pin: u8,
8608 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8609 #[cfg_attr(feature = "ts", ts(type = "string"))]
8610 pub pin: CharArray<16>,
8611 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8612 #[cfg_attr(feature = "ts", ts(type = "string"))]
8613 pub new_pin: CharArray<16>,
8614 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8615 #[cfg_attr(feature = "ts", ts(type = "string"))]
8616 pub apn: CharArray<32>,
8617 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8618 #[cfg_attr(feature = "ts", ts(type = "string"))]
8619 pub puk: CharArray<16>,
8620 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8621 pub roaming: u8,
8622 #[doc = "Message acceptance response (sent back to GS)."]
8623 pub response: CellularConfigResponse,
8624}
8625impl CELLULAR_CONFIG_DATA {
8626 pub const ENCODED_LEN: usize = 84usize;
8627 pub const DEFAULT: Self = Self {
8628 enable_lte: 0_u8,
8629 enable_pin: 0_u8,
8630 pin: CharArray::new([0_u8; 16usize]),
8631 new_pin: CharArray::new([0_u8; 16usize]),
8632 apn: CharArray::new([0_u8; 32usize]),
8633 puk: CharArray::new([0_u8; 16usize]),
8634 roaming: 0_u8,
8635 response: CellularConfigResponse::DEFAULT,
8636 };
8637 #[cfg(feature = "arbitrary")]
8638 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8639 use arbitrary::{Arbitrary, Unstructured};
8640 let mut buf = [0u8; 1024];
8641 rng.fill_bytes(&mut buf);
8642 let mut unstructured = Unstructured::new(&buf);
8643 Self::arbitrary(&mut unstructured).unwrap_or_default()
8644 }
8645}
8646impl Default for CELLULAR_CONFIG_DATA {
8647 fn default() -> Self {
8648 Self::DEFAULT.clone()
8649 }
8650}
8651impl MessageData for CELLULAR_CONFIG_DATA {
8652 type Message = MavMessage;
8653 const ID: u32 = 336u32;
8654 const NAME: &'static str = "CELLULAR_CONFIG";
8655 const EXTRA_CRC: u8 = 245u8;
8656 const ENCODED_LEN: usize = 84usize;
8657 fn deser(
8658 _version: MavlinkVersion,
8659 __input: &[u8],
8660 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8661 let avail_len = __input.len();
8662 let mut payload_buf = [0; Self::ENCODED_LEN];
8663 let mut buf = if avail_len < Self::ENCODED_LEN {
8664 payload_buf[0..avail_len].copy_from_slice(__input);
8665 Bytes::new(&payload_buf)
8666 } else {
8667 Bytes::new(__input)
8668 };
8669 let mut __struct = Self::default();
8670 __struct.enable_lte = buf.get_u8()?;
8671 __struct.enable_pin = buf.get_u8()?;
8672 let mut tmp = [0_u8; 16usize];
8673 for v in &mut tmp {
8674 *v = buf.get_u8()?;
8675 }
8676 __struct.pin = CharArray::new(tmp);
8677 let mut tmp = [0_u8; 16usize];
8678 for v in &mut tmp {
8679 *v = buf.get_u8()?;
8680 }
8681 __struct.new_pin = CharArray::new(tmp);
8682 let mut tmp = [0_u8; 32usize];
8683 for v in &mut tmp {
8684 *v = buf.get_u8()?;
8685 }
8686 __struct.apn = CharArray::new(tmp);
8687 let mut tmp = [0_u8; 16usize];
8688 for v in &mut tmp {
8689 *v = buf.get_u8()?;
8690 }
8691 __struct.puk = CharArray::new(tmp);
8692 __struct.roaming = buf.get_u8()?;
8693 let tmp = buf.get_u8()?;
8694 __struct.response =
8695 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8696 enum_type: "CellularConfigResponse",
8697 value: tmp as u64,
8698 })?;
8699 Ok(__struct)
8700 }
8701 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8702 let mut __tmp = BytesMut::new(bytes);
8703 #[allow(clippy::absurd_extreme_comparisons)]
8704 #[allow(unused_comparisons)]
8705 if __tmp.remaining() < Self::ENCODED_LEN {
8706 panic!(
8707 "buffer is too small (need {} bytes, but got {})",
8708 Self::ENCODED_LEN,
8709 __tmp.remaining(),
8710 )
8711 }
8712 __tmp.put_u8(self.enable_lte);
8713 __tmp.put_u8(self.enable_pin);
8714 for val in &self.pin {
8715 __tmp.put_u8(*val);
8716 }
8717 for val in &self.new_pin {
8718 __tmp.put_u8(*val);
8719 }
8720 for val in &self.apn {
8721 __tmp.put_u8(*val);
8722 }
8723 for val in &self.puk {
8724 __tmp.put_u8(*val);
8725 }
8726 __tmp.put_u8(self.roaming);
8727 __tmp.put_u8(self.response as u8);
8728 if matches!(version, MavlinkVersion::V2) {
8729 let len = __tmp.len();
8730 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8731 } else {
8732 __tmp.len()
8733 }
8734 }
8735}
8736#[doc = "Report current used cellular network status."]
8737#[doc = ""]
8738#[doc = "ID: 334"]
8739#[derive(Debug, Clone, PartialEq)]
8740#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8741#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8742#[cfg_attr(feature = "ts", derive(TS))]
8743#[cfg_attr(feature = "ts", ts(export))]
8744pub struct CELLULAR_STATUS_DATA {
8745 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
8746 pub mcc: u16,
8747 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
8748 pub mnc: u16,
8749 #[doc = "Location area code. If unknown, set to 0"]
8750 pub lac: u16,
8751 #[doc = "Cellular modem status"]
8752 pub status: CellularStatusFlag,
8753 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
8754 pub failure_reason: CellularNetworkFailedReason,
8755 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
8756 pub mavtype: CellularNetworkRadioType,
8757 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
8758 pub quality: u8,
8759}
8760impl CELLULAR_STATUS_DATA {
8761 pub const ENCODED_LEN: usize = 10usize;
8762 pub const DEFAULT: Self = Self {
8763 mcc: 0_u16,
8764 mnc: 0_u16,
8765 lac: 0_u16,
8766 status: CellularStatusFlag::DEFAULT,
8767 failure_reason: CellularNetworkFailedReason::DEFAULT,
8768 mavtype: CellularNetworkRadioType::DEFAULT,
8769 quality: 0_u8,
8770 };
8771 #[cfg(feature = "arbitrary")]
8772 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8773 use arbitrary::{Arbitrary, Unstructured};
8774 let mut buf = [0u8; 1024];
8775 rng.fill_bytes(&mut buf);
8776 let mut unstructured = Unstructured::new(&buf);
8777 Self::arbitrary(&mut unstructured).unwrap_or_default()
8778 }
8779}
8780impl Default for CELLULAR_STATUS_DATA {
8781 fn default() -> Self {
8782 Self::DEFAULT.clone()
8783 }
8784}
8785impl MessageData for CELLULAR_STATUS_DATA {
8786 type Message = MavMessage;
8787 const ID: u32 = 334u32;
8788 const NAME: &'static str = "CELLULAR_STATUS";
8789 const EXTRA_CRC: u8 = 72u8;
8790 const ENCODED_LEN: usize = 10usize;
8791 fn deser(
8792 _version: MavlinkVersion,
8793 __input: &[u8],
8794 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8795 let avail_len = __input.len();
8796 let mut payload_buf = [0; Self::ENCODED_LEN];
8797 let mut buf = if avail_len < Self::ENCODED_LEN {
8798 payload_buf[0..avail_len].copy_from_slice(__input);
8799 Bytes::new(&payload_buf)
8800 } else {
8801 Bytes::new(__input)
8802 };
8803 let mut __struct = Self::default();
8804 __struct.mcc = buf.get_u16_le()?;
8805 __struct.mnc = buf.get_u16_le()?;
8806 __struct.lac = buf.get_u16_le()?;
8807 let tmp = buf.get_u8()?;
8808 __struct.status =
8809 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8810 enum_type: "CellularStatusFlag",
8811 value: tmp as u64,
8812 })?;
8813 let tmp = buf.get_u8()?;
8814 __struct.failure_reason =
8815 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8816 enum_type: "CellularNetworkFailedReason",
8817 value: tmp as u64,
8818 })?;
8819 let tmp = buf.get_u8()?;
8820 __struct.mavtype =
8821 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8822 enum_type: "CellularNetworkRadioType",
8823 value: tmp as u64,
8824 })?;
8825 __struct.quality = buf.get_u8()?;
8826 Ok(__struct)
8827 }
8828 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8829 let mut __tmp = BytesMut::new(bytes);
8830 #[allow(clippy::absurd_extreme_comparisons)]
8831 #[allow(unused_comparisons)]
8832 if __tmp.remaining() < Self::ENCODED_LEN {
8833 panic!(
8834 "buffer is too small (need {} bytes, but got {})",
8835 Self::ENCODED_LEN,
8836 __tmp.remaining(),
8837 )
8838 }
8839 __tmp.put_u16_le(self.mcc);
8840 __tmp.put_u16_le(self.mnc);
8841 __tmp.put_u16_le(self.lac);
8842 __tmp.put_u8(self.status as u8);
8843 __tmp.put_u8(self.failure_reason as u8);
8844 __tmp.put_u8(self.mavtype as u8);
8845 __tmp.put_u8(self.quality);
8846 if matches!(version, MavlinkVersion::V2) {
8847 let len = __tmp.len();
8848 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8849 } else {
8850 __tmp.len()
8851 }
8852 }
8853}
8854#[doc = "Request to control this MAV."]
8855#[doc = ""]
8856#[doc = "ID: 5"]
8857#[derive(Debug, Clone, PartialEq)]
8858#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8859#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8860#[cfg_attr(feature = "ts", derive(TS))]
8861#[cfg_attr(feature = "ts", ts(export))]
8862pub struct CHANGE_OPERATOR_CONTROL_DATA {
8863 #[doc = "System the GCS requests control for"]
8864 pub target_system: u8,
8865 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8866 pub control_request: u8,
8867 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
8868 pub version: u8,
8869 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
8870 #[cfg_attr(feature = "ts", ts(type = "string"))]
8871 pub passkey: CharArray<25>,
8872}
8873impl CHANGE_OPERATOR_CONTROL_DATA {
8874 pub const ENCODED_LEN: usize = 28usize;
8875 pub const DEFAULT: Self = Self {
8876 target_system: 0_u8,
8877 control_request: 0_u8,
8878 version: 0_u8,
8879 passkey: CharArray::new([0_u8; 25usize]),
8880 };
8881 #[cfg(feature = "arbitrary")]
8882 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8883 use arbitrary::{Arbitrary, Unstructured};
8884 let mut buf = [0u8; 1024];
8885 rng.fill_bytes(&mut buf);
8886 let mut unstructured = Unstructured::new(&buf);
8887 Self::arbitrary(&mut unstructured).unwrap_or_default()
8888 }
8889}
8890impl Default for CHANGE_OPERATOR_CONTROL_DATA {
8891 fn default() -> Self {
8892 Self::DEFAULT.clone()
8893 }
8894}
8895impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
8896 type Message = MavMessage;
8897 const ID: u32 = 5u32;
8898 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
8899 const EXTRA_CRC: u8 = 217u8;
8900 const ENCODED_LEN: usize = 28usize;
8901 fn deser(
8902 _version: MavlinkVersion,
8903 __input: &[u8],
8904 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8905 let avail_len = __input.len();
8906 let mut payload_buf = [0; Self::ENCODED_LEN];
8907 let mut buf = if avail_len < Self::ENCODED_LEN {
8908 payload_buf[0..avail_len].copy_from_slice(__input);
8909 Bytes::new(&payload_buf)
8910 } else {
8911 Bytes::new(__input)
8912 };
8913 let mut __struct = Self::default();
8914 __struct.target_system = buf.get_u8()?;
8915 __struct.control_request = buf.get_u8()?;
8916 __struct.version = buf.get_u8()?;
8917 let mut tmp = [0_u8; 25usize];
8918 for v in &mut tmp {
8919 *v = buf.get_u8()?;
8920 }
8921 __struct.passkey = CharArray::new(tmp);
8922 Ok(__struct)
8923 }
8924 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8925 let mut __tmp = BytesMut::new(bytes);
8926 #[allow(clippy::absurd_extreme_comparisons)]
8927 #[allow(unused_comparisons)]
8928 if __tmp.remaining() < Self::ENCODED_LEN {
8929 panic!(
8930 "buffer is too small (need {} bytes, but got {})",
8931 Self::ENCODED_LEN,
8932 __tmp.remaining(),
8933 )
8934 }
8935 __tmp.put_u8(self.target_system);
8936 __tmp.put_u8(self.control_request);
8937 __tmp.put_u8(self.version);
8938 for val in &self.passkey {
8939 __tmp.put_u8(*val);
8940 }
8941 if matches!(version, MavlinkVersion::V2) {
8942 let len = __tmp.len();
8943 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8944 } else {
8945 __tmp.len()
8946 }
8947 }
8948}
8949#[doc = "Accept / deny control of this MAV."]
8950#[doc = ""]
8951#[doc = "ID: 6"]
8952#[derive(Debug, Clone, PartialEq)]
8953#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8954#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8955#[cfg_attr(feature = "ts", derive(TS))]
8956#[cfg_attr(feature = "ts", ts(export))]
8957pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
8958 #[doc = "ID of the GCS this message"]
8959 pub gcs_system_id: u8,
8960 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8961 pub control_request: u8,
8962 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
8963 pub ack: u8,
8964}
8965impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
8966 pub const ENCODED_LEN: usize = 3usize;
8967 pub const DEFAULT: Self = Self {
8968 gcs_system_id: 0_u8,
8969 control_request: 0_u8,
8970 ack: 0_u8,
8971 };
8972 #[cfg(feature = "arbitrary")]
8973 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8974 use arbitrary::{Arbitrary, Unstructured};
8975 let mut buf = [0u8; 1024];
8976 rng.fill_bytes(&mut buf);
8977 let mut unstructured = Unstructured::new(&buf);
8978 Self::arbitrary(&mut unstructured).unwrap_or_default()
8979 }
8980}
8981impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8982 fn default() -> Self {
8983 Self::DEFAULT.clone()
8984 }
8985}
8986impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8987 type Message = MavMessage;
8988 const ID: u32 = 6u32;
8989 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
8990 const EXTRA_CRC: u8 = 104u8;
8991 const ENCODED_LEN: usize = 3usize;
8992 fn deser(
8993 _version: MavlinkVersion,
8994 __input: &[u8],
8995 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8996 let avail_len = __input.len();
8997 let mut payload_buf = [0; Self::ENCODED_LEN];
8998 let mut buf = if avail_len < Self::ENCODED_LEN {
8999 payload_buf[0..avail_len].copy_from_slice(__input);
9000 Bytes::new(&payload_buf)
9001 } else {
9002 Bytes::new(__input)
9003 };
9004 let mut __struct = Self::default();
9005 __struct.gcs_system_id = buf.get_u8()?;
9006 __struct.control_request = buf.get_u8()?;
9007 __struct.ack = buf.get_u8()?;
9008 Ok(__struct)
9009 }
9010 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9011 let mut __tmp = BytesMut::new(bytes);
9012 #[allow(clippy::absurd_extreme_comparisons)]
9013 #[allow(unused_comparisons)]
9014 if __tmp.remaining() < Self::ENCODED_LEN {
9015 panic!(
9016 "buffer is too small (need {} bytes, but got {})",
9017 Self::ENCODED_LEN,
9018 __tmp.remaining(),
9019 )
9020 }
9021 __tmp.put_u8(self.gcs_system_id);
9022 __tmp.put_u8(self.control_request);
9023 __tmp.put_u8(self.ack);
9024 if matches!(version, MavlinkVersion::V2) {
9025 let len = __tmp.len();
9026 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9027 } else {
9028 __tmp.len()
9029 }
9030 }
9031}
9032#[doc = "Information about a potential collision."]
9033#[doc = ""]
9034#[doc = "ID: 247"]
9035#[derive(Debug, Clone, PartialEq)]
9036#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9037#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9038#[cfg_attr(feature = "ts", derive(TS))]
9039#[cfg_attr(feature = "ts", ts(export))]
9040pub struct COLLISION_DATA {
9041 #[doc = "Unique identifier, domain based on src field"]
9042 pub id: u32,
9043 #[doc = "Estimated time until collision occurs"]
9044 pub time_to_minimum_delta: f32,
9045 #[doc = "Closest vertical distance between vehicle and object"]
9046 pub altitude_minimum_delta: f32,
9047 #[doc = "Closest horizontal distance between vehicle and object"]
9048 pub horizontal_minimum_delta: f32,
9049 #[doc = "Collision data source"]
9050 pub src: MavCollisionSrc,
9051 #[doc = "Action that is being taken to avoid this collision"]
9052 pub action: MavCollisionAction,
9053 #[doc = "How concerned the aircraft is about this collision"]
9054 pub threat_level: MavCollisionThreatLevel,
9055}
9056impl COLLISION_DATA {
9057 pub const ENCODED_LEN: usize = 19usize;
9058 pub const DEFAULT: Self = Self {
9059 id: 0_u32,
9060 time_to_minimum_delta: 0.0_f32,
9061 altitude_minimum_delta: 0.0_f32,
9062 horizontal_minimum_delta: 0.0_f32,
9063 src: MavCollisionSrc::DEFAULT,
9064 action: MavCollisionAction::DEFAULT,
9065 threat_level: MavCollisionThreatLevel::DEFAULT,
9066 };
9067 #[cfg(feature = "arbitrary")]
9068 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9069 use arbitrary::{Arbitrary, Unstructured};
9070 let mut buf = [0u8; 1024];
9071 rng.fill_bytes(&mut buf);
9072 let mut unstructured = Unstructured::new(&buf);
9073 Self::arbitrary(&mut unstructured).unwrap_or_default()
9074 }
9075}
9076impl Default for COLLISION_DATA {
9077 fn default() -> Self {
9078 Self::DEFAULT.clone()
9079 }
9080}
9081impl MessageData for COLLISION_DATA {
9082 type Message = MavMessage;
9083 const ID: u32 = 247u32;
9084 const NAME: &'static str = "COLLISION";
9085 const EXTRA_CRC: u8 = 81u8;
9086 const ENCODED_LEN: usize = 19usize;
9087 fn deser(
9088 _version: MavlinkVersion,
9089 __input: &[u8],
9090 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9091 let avail_len = __input.len();
9092 let mut payload_buf = [0; Self::ENCODED_LEN];
9093 let mut buf = if avail_len < Self::ENCODED_LEN {
9094 payload_buf[0..avail_len].copy_from_slice(__input);
9095 Bytes::new(&payload_buf)
9096 } else {
9097 Bytes::new(__input)
9098 };
9099 let mut __struct = Self::default();
9100 __struct.id = buf.get_u32_le()?;
9101 __struct.time_to_minimum_delta = buf.get_f32_le()?;
9102 __struct.altitude_minimum_delta = buf.get_f32_le()?;
9103 __struct.horizontal_minimum_delta = buf.get_f32_le()?;
9104 let tmp = buf.get_u8()?;
9105 __struct.src =
9106 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9107 enum_type: "MavCollisionSrc",
9108 value: tmp as u64,
9109 })?;
9110 let tmp = buf.get_u8()?;
9111 __struct.action =
9112 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9113 enum_type: "MavCollisionAction",
9114 value: tmp as u64,
9115 })?;
9116 let tmp = buf.get_u8()?;
9117 __struct.threat_level =
9118 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9119 enum_type: "MavCollisionThreatLevel",
9120 value: tmp as u64,
9121 })?;
9122 Ok(__struct)
9123 }
9124 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9125 let mut __tmp = BytesMut::new(bytes);
9126 #[allow(clippy::absurd_extreme_comparisons)]
9127 #[allow(unused_comparisons)]
9128 if __tmp.remaining() < Self::ENCODED_LEN {
9129 panic!(
9130 "buffer is too small (need {} bytes, but got {})",
9131 Self::ENCODED_LEN,
9132 __tmp.remaining(),
9133 )
9134 }
9135 __tmp.put_u32_le(self.id);
9136 __tmp.put_f32_le(self.time_to_minimum_delta);
9137 __tmp.put_f32_le(self.altitude_minimum_delta);
9138 __tmp.put_f32_le(self.horizontal_minimum_delta);
9139 __tmp.put_u8(self.src as u8);
9140 __tmp.put_u8(self.action as u8);
9141 __tmp.put_u8(self.threat_level as u8);
9142 if matches!(version, MavlinkVersion::V2) {
9143 let len = __tmp.len();
9144 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9145 } else {
9146 __tmp.len()
9147 }
9148 }
9149}
9150#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9151#[doc = ""]
9152#[doc = "ID: 77"]
9153#[derive(Debug, Clone, PartialEq)]
9154#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9155#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9156#[cfg_attr(feature = "ts", derive(TS))]
9157#[cfg_attr(feature = "ts", ts(export))]
9158pub struct COMMAND_ACK_DATA {
9159 #[doc = "Command ID (of acknowledged command)."]
9160 pub command: MavCmd,
9161 #[doc = "Result of command."]
9162 pub result: MavResult,
9163 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
9164 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9165 pub progress: u8,
9166 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
9167 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9168 pub result_param2: i32,
9169 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9170 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9171 pub target_system: u8,
9172 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9173 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9174 pub target_component: u8,
9175}
9176impl COMMAND_ACK_DATA {
9177 pub const ENCODED_LEN: usize = 10usize;
9178 pub const DEFAULT: Self = Self {
9179 command: MavCmd::DEFAULT,
9180 result: MavResult::DEFAULT,
9181 progress: 0_u8,
9182 result_param2: 0_i32,
9183 target_system: 0_u8,
9184 target_component: 0_u8,
9185 };
9186 #[cfg(feature = "arbitrary")]
9187 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9188 use arbitrary::{Arbitrary, Unstructured};
9189 let mut buf = [0u8; 1024];
9190 rng.fill_bytes(&mut buf);
9191 let mut unstructured = Unstructured::new(&buf);
9192 Self::arbitrary(&mut unstructured).unwrap_or_default()
9193 }
9194}
9195impl Default for COMMAND_ACK_DATA {
9196 fn default() -> Self {
9197 Self::DEFAULT.clone()
9198 }
9199}
9200impl MessageData for COMMAND_ACK_DATA {
9201 type Message = MavMessage;
9202 const ID: u32 = 77u32;
9203 const NAME: &'static str = "COMMAND_ACK";
9204 const EXTRA_CRC: u8 = 143u8;
9205 const ENCODED_LEN: usize = 10usize;
9206 fn deser(
9207 _version: MavlinkVersion,
9208 __input: &[u8],
9209 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9210 let avail_len = __input.len();
9211 let mut payload_buf = [0; Self::ENCODED_LEN];
9212 let mut buf = if avail_len < Self::ENCODED_LEN {
9213 payload_buf[0..avail_len].copy_from_slice(__input);
9214 Bytes::new(&payload_buf)
9215 } else {
9216 Bytes::new(__input)
9217 };
9218 let mut __struct = Self::default();
9219 let tmp = buf.get_u16_le()?;
9220 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9221 ::mavlink_core::error::ParserError::InvalidEnum {
9222 enum_type: "MavCmd",
9223 value: tmp as u64,
9224 },
9225 )?;
9226 let tmp = buf.get_u8()?;
9227 __struct.result =
9228 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9229 enum_type: "MavResult",
9230 value: tmp as u64,
9231 })?;
9232 __struct.progress = buf.get_u8()?;
9233 __struct.result_param2 = buf.get_i32_le()?;
9234 __struct.target_system = buf.get_u8()?;
9235 __struct.target_component = buf.get_u8()?;
9236 Ok(__struct)
9237 }
9238 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9239 let mut __tmp = BytesMut::new(bytes);
9240 #[allow(clippy::absurd_extreme_comparisons)]
9241 #[allow(unused_comparisons)]
9242 if __tmp.remaining() < Self::ENCODED_LEN {
9243 panic!(
9244 "buffer is too small (need {} bytes, but got {})",
9245 Self::ENCODED_LEN,
9246 __tmp.remaining(),
9247 )
9248 }
9249 __tmp.put_u16_le(self.command as u16);
9250 __tmp.put_u8(self.result as u8);
9251 if matches!(version, MavlinkVersion::V2) {
9252 __tmp.put_u8(self.progress);
9253 __tmp.put_i32_le(self.result_param2);
9254 __tmp.put_u8(self.target_system);
9255 __tmp.put_u8(self.target_component);
9256 let len = __tmp.len();
9257 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9258 } else {
9259 __tmp.len()
9260 }
9261 }
9262}
9263#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9264#[doc = ""]
9265#[doc = "ID: 80"]
9266#[derive(Debug, Clone, PartialEq)]
9267#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9268#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9269#[cfg_attr(feature = "ts", derive(TS))]
9270#[cfg_attr(feature = "ts", ts(export))]
9271pub struct COMMAND_CANCEL_DATA {
9272 #[doc = "Command ID (of command to cancel)."]
9273 pub command: MavCmd,
9274 #[doc = "System executing long running command. Should not be broadcast (0)."]
9275 pub target_system: u8,
9276 #[doc = "Component executing long running command."]
9277 pub target_component: u8,
9278}
9279impl COMMAND_CANCEL_DATA {
9280 pub const ENCODED_LEN: usize = 4usize;
9281 pub const DEFAULT: Self = Self {
9282 command: MavCmd::DEFAULT,
9283 target_system: 0_u8,
9284 target_component: 0_u8,
9285 };
9286 #[cfg(feature = "arbitrary")]
9287 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9288 use arbitrary::{Arbitrary, Unstructured};
9289 let mut buf = [0u8; 1024];
9290 rng.fill_bytes(&mut buf);
9291 let mut unstructured = Unstructured::new(&buf);
9292 Self::arbitrary(&mut unstructured).unwrap_or_default()
9293 }
9294}
9295impl Default for COMMAND_CANCEL_DATA {
9296 fn default() -> Self {
9297 Self::DEFAULT.clone()
9298 }
9299}
9300impl MessageData for COMMAND_CANCEL_DATA {
9301 type Message = MavMessage;
9302 const ID: u32 = 80u32;
9303 const NAME: &'static str = "COMMAND_CANCEL";
9304 const EXTRA_CRC: u8 = 14u8;
9305 const ENCODED_LEN: usize = 4usize;
9306 fn deser(
9307 _version: MavlinkVersion,
9308 __input: &[u8],
9309 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9310 let avail_len = __input.len();
9311 let mut payload_buf = [0; Self::ENCODED_LEN];
9312 let mut buf = if avail_len < Self::ENCODED_LEN {
9313 payload_buf[0..avail_len].copy_from_slice(__input);
9314 Bytes::new(&payload_buf)
9315 } else {
9316 Bytes::new(__input)
9317 };
9318 let mut __struct = Self::default();
9319 let tmp = buf.get_u16_le()?;
9320 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9321 ::mavlink_core::error::ParserError::InvalidEnum {
9322 enum_type: "MavCmd",
9323 value: tmp as u64,
9324 },
9325 )?;
9326 __struct.target_system = buf.get_u8()?;
9327 __struct.target_component = buf.get_u8()?;
9328 Ok(__struct)
9329 }
9330 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9331 let mut __tmp = BytesMut::new(bytes);
9332 #[allow(clippy::absurd_extreme_comparisons)]
9333 #[allow(unused_comparisons)]
9334 if __tmp.remaining() < Self::ENCODED_LEN {
9335 panic!(
9336 "buffer is too small (need {} bytes, but got {})",
9337 Self::ENCODED_LEN,
9338 __tmp.remaining(),
9339 )
9340 }
9341 __tmp.put_u16_le(self.command as u16);
9342 __tmp.put_u8(self.target_system);
9343 __tmp.put_u8(self.target_component);
9344 if matches!(version, MavlinkVersion::V2) {
9345 let len = __tmp.len();
9346 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9347 } else {
9348 __tmp.len()
9349 }
9350 }
9351}
9352#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9353#[doc = ""]
9354#[doc = "ID: 75"]
9355#[derive(Debug, Clone, PartialEq)]
9356#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9357#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9358#[cfg_attr(feature = "ts", derive(TS))]
9359#[cfg_attr(feature = "ts", ts(export))]
9360pub struct COMMAND_INT_DATA {
9361 #[doc = "PARAM1, see MAV_CMD enum"]
9362 pub param1: f32,
9363 #[doc = "PARAM2, see MAV_CMD enum"]
9364 pub param2: f32,
9365 #[doc = "PARAM3, see MAV_CMD enum"]
9366 pub param3: f32,
9367 #[doc = "PARAM4, see MAV_CMD enum"]
9368 pub param4: f32,
9369 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
9370 pub x: i32,
9371 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
9372 pub y: i32,
9373 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
9374 pub z: f32,
9375 #[doc = "The scheduled action for the mission item."]
9376 pub command: MavCmd,
9377 #[doc = "System ID"]
9378 pub target_system: u8,
9379 #[doc = "Component ID"]
9380 pub target_component: u8,
9381 #[doc = "The coordinate system of the COMMAND."]
9382 pub frame: MavFrame,
9383 #[doc = "Not used."]
9384 pub current: u8,
9385 #[doc = "Not used (set 0)."]
9386 pub autocontinue: u8,
9387}
9388impl COMMAND_INT_DATA {
9389 pub const ENCODED_LEN: usize = 35usize;
9390 pub const DEFAULT: Self = Self {
9391 param1: 0.0_f32,
9392 param2: 0.0_f32,
9393 param3: 0.0_f32,
9394 param4: 0.0_f32,
9395 x: 0_i32,
9396 y: 0_i32,
9397 z: 0.0_f32,
9398 command: MavCmd::DEFAULT,
9399 target_system: 0_u8,
9400 target_component: 0_u8,
9401 frame: MavFrame::DEFAULT,
9402 current: 0_u8,
9403 autocontinue: 0_u8,
9404 };
9405 #[cfg(feature = "arbitrary")]
9406 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9407 use arbitrary::{Arbitrary, Unstructured};
9408 let mut buf = [0u8; 1024];
9409 rng.fill_bytes(&mut buf);
9410 let mut unstructured = Unstructured::new(&buf);
9411 Self::arbitrary(&mut unstructured).unwrap_or_default()
9412 }
9413}
9414impl Default for COMMAND_INT_DATA {
9415 fn default() -> Self {
9416 Self::DEFAULT.clone()
9417 }
9418}
9419impl MessageData for COMMAND_INT_DATA {
9420 type Message = MavMessage;
9421 const ID: u32 = 75u32;
9422 const NAME: &'static str = "COMMAND_INT";
9423 const EXTRA_CRC: u8 = 158u8;
9424 const ENCODED_LEN: usize = 35usize;
9425 fn deser(
9426 _version: MavlinkVersion,
9427 __input: &[u8],
9428 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9429 let avail_len = __input.len();
9430 let mut payload_buf = [0; Self::ENCODED_LEN];
9431 let mut buf = if avail_len < Self::ENCODED_LEN {
9432 payload_buf[0..avail_len].copy_from_slice(__input);
9433 Bytes::new(&payload_buf)
9434 } else {
9435 Bytes::new(__input)
9436 };
9437 let mut __struct = Self::default();
9438 __struct.param1 = buf.get_f32_le()?;
9439 __struct.param2 = buf.get_f32_le()?;
9440 __struct.param3 = buf.get_f32_le()?;
9441 __struct.param4 = buf.get_f32_le()?;
9442 __struct.x = buf.get_i32_le()?;
9443 __struct.y = buf.get_i32_le()?;
9444 __struct.z = buf.get_f32_le()?;
9445 let tmp = buf.get_u16_le()?;
9446 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9447 ::mavlink_core::error::ParserError::InvalidEnum {
9448 enum_type: "MavCmd",
9449 value: tmp as u64,
9450 },
9451 )?;
9452 __struct.target_system = buf.get_u8()?;
9453 __struct.target_component = buf.get_u8()?;
9454 let tmp = buf.get_u8()?;
9455 __struct.frame =
9456 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9457 enum_type: "MavFrame",
9458 value: tmp as u64,
9459 })?;
9460 __struct.current = buf.get_u8()?;
9461 __struct.autocontinue = buf.get_u8()?;
9462 Ok(__struct)
9463 }
9464 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9465 let mut __tmp = BytesMut::new(bytes);
9466 #[allow(clippy::absurd_extreme_comparisons)]
9467 #[allow(unused_comparisons)]
9468 if __tmp.remaining() < Self::ENCODED_LEN {
9469 panic!(
9470 "buffer is too small (need {} bytes, but got {})",
9471 Self::ENCODED_LEN,
9472 __tmp.remaining(),
9473 )
9474 }
9475 __tmp.put_f32_le(self.param1);
9476 __tmp.put_f32_le(self.param2);
9477 __tmp.put_f32_le(self.param3);
9478 __tmp.put_f32_le(self.param4);
9479 __tmp.put_i32_le(self.x);
9480 __tmp.put_i32_le(self.y);
9481 __tmp.put_f32_le(self.z);
9482 __tmp.put_u16_le(self.command as u16);
9483 __tmp.put_u8(self.target_system);
9484 __tmp.put_u8(self.target_component);
9485 __tmp.put_u8(self.frame as u8);
9486 __tmp.put_u8(self.current);
9487 __tmp.put_u8(self.autocontinue);
9488 if matches!(version, MavlinkVersion::V2) {
9489 let len = __tmp.len();
9490 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9491 } else {
9492 __tmp.len()
9493 }
9494 }
9495}
9496#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9497#[doc = ""]
9498#[doc = "ID: 76"]
9499#[derive(Debug, Clone, PartialEq)]
9500#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9501#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9502#[cfg_attr(feature = "ts", derive(TS))]
9503#[cfg_attr(feature = "ts", ts(export))]
9504pub struct COMMAND_LONG_DATA {
9505 #[doc = "Parameter 1 (for the specific command)."]
9506 pub param1: f32,
9507 #[doc = "Parameter 2 (for the specific command)."]
9508 pub param2: f32,
9509 #[doc = "Parameter 3 (for the specific command)."]
9510 pub param3: f32,
9511 #[doc = "Parameter 4 (for the specific command)."]
9512 pub param4: f32,
9513 #[doc = "Parameter 5 (for the specific command)."]
9514 pub param5: f32,
9515 #[doc = "Parameter 6 (for the specific command)."]
9516 pub param6: f32,
9517 #[doc = "Parameter 7 (for the specific command)."]
9518 pub param7: f32,
9519 #[doc = "Command ID (of command to send)."]
9520 pub command: MavCmd,
9521 #[doc = "System which should execute the command"]
9522 pub target_system: u8,
9523 #[doc = "Component which should execute the command, 0 for all components"]
9524 pub target_component: u8,
9525 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
9526 pub confirmation: u8,
9527}
9528impl COMMAND_LONG_DATA {
9529 pub const ENCODED_LEN: usize = 33usize;
9530 pub const DEFAULT: Self = Self {
9531 param1: 0.0_f32,
9532 param2: 0.0_f32,
9533 param3: 0.0_f32,
9534 param4: 0.0_f32,
9535 param5: 0.0_f32,
9536 param6: 0.0_f32,
9537 param7: 0.0_f32,
9538 command: MavCmd::DEFAULT,
9539 target_system: 0_u8,
9540 target_component: 0_u8,
9541 confirmation: 0_u8,
9542 };
9543 #[cfg(feature = "arbitrary")]
9544 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9545 use arbitrary::{Arbitrary, Unstructured};
9546 let mut buf = [0u8; 1024];
9547 rng.fill_bytes(&mut buf);
9548 let mut unstructured = Unstructured::new(&buf);
9549 Self::arbitrary(&mut unstructured).unwrap_or_default()
9550 }
9551}
9552impl Default for COMMAND_LONG_DATA {
9553 fn default() -> Self {
9554 Self::DEFAULT.clone()
9555 }
9556}
9557impl MessageData for COMMAND_LONG_DATA {
9558 type Message = MavMessage;
9559 const ID: u32 = 76u32;
9560 const NAME: &'static str = "COMMAND_LONG";
9561 const EXTRA_CRC: u8 = 152u8;
9562 const ENCODED_LEN: usize = 33usize;
9563 fn deser(
9564 _version: MavlinkVersion,
9565 __input: &[u8],
9566 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9567 let avail_len = __input.len();
9568 let mut payload_buf = [0; Self::ENCODED_LEN];
9569 let mut buf = if avail_len < Self::ENCODED_LEN {
9570 payload_buf[0..avail_len].copy_from_slice(__input);
9571 Bytes::new(&payload_buf)
9572 } else {
9573 Bytes::new(__input)
9574 };
9575 let mut __struct = Self::default();
9576 __struct.param1 = buf.get_f32_le()?;
9577 __struct.param2 = buf.get_f32_le()?;
9578 __struct.param3 = buf.get_f32_le()?;
9579 __struct.param4 = buf.get_f32_le()?;
9580 __struct.param5 = buf.get_f32_le()?;
9581 __struct.param6 = buf.get_f32_le()?;
9582 __struct.param7 = buf.get_f32_le()?;
9583 let tmp = buf.get_u16_le()?;
9584 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9585 ::mavlink_core::error::ParserError::InvalidEnum {
9586 enum_type: "MavCmd",
9587 value: tmp as u64,
9588 },
9589 )?;
9590 __struct.target_system = buf.get_u8()?;
9591 __struct.target_component = buf.get_u8()?;
9592 __struct.confirmation = buf.get_u8()?;
9593 Ok(__struct)
9594 }
9595 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9596 let mut __tmp = BytesMut::new(bytes);
9597 #[allow(clippy::absurd_extreme_comparisons)]
9598 #[allow(unused_comparisons)]
9599 if __tmp.remaining() < Self::ENCODED_LEN {
9600 panic!(
9601 "buffer is too small (need {} bytes, but got {})",
9602 Self::ENCODED_LEN,
9603 __tmp.remaining(),
9604 )
9605 }
9606 __tmp.put_f32_le(self.param1);
9607 __tmp.put_f32_le(self.param2);
9608 __tmp.put_f32_le(self.param3);
9609 __tmp.put_f32_le(self.param4);
9610 __tmp.put_f32_le(self.param5);
9611 __tmp.put_f32_le(self.param6);
9612 __tmp.put_f32_le(self.param7);
9613 __tmp.put_u16_le(self.command as u16);
9614 __tmp.put_u8(self.target_system);
9615 __tmp.put_u8(self.target_component);
9616 __tmp.put_u8(self.confirmation);
9617 if matches!(version, MavlinkVersion::V2) {
9618 let len = __tmp.len();
9619 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9620 } else {
9621 __tmp.len()
9622 }
9623 }
9624}
9625#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
9626#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
9627#[doc = ""]
9628#[doc = "ID: 395"]
9629#[derive(Debug, Clone, PartialEq)]
9630#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9631#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9632#[cfg_attr(feature = "ts", derive(TS))]
9633#[cfg_attr(feature = "ts", ts(export))]
9634pub struct COMPONENT_INFORMATION_DATA {
9635 #[doc = "Timestamp (time since system boot)."]
9636 pub time_boot_ms: u32,
9637 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
9638 pub general_metadata_file_crc: u32,
9639 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
9640 pub peripherals_metadata_file_crc: u32,
9641 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9642 #[cfg_attr(feature = "ts", ts(type = "string"))]
9643 pub general_metadata_uri: CharArray<100>,
9644 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
9645 #[cfg_attr(feature = "ts", ts(type = "string"))]
9646 pub peripherals_metadata_uri: CharArray<100>,
9647}
9648impl COMPONENT_INFORMATION_DATA {
9649 pub const ENCODED_LEN: usize = 212usize;
9650 pub const DEFAULT: Self = Self {
9651 time_boot_ms: 0_u32,
9652 general_metadata_file_crc: 0_u32,
9653 peripherals_metadata_file_crc: 0_u32,
9654 general_metadata_uri: CharArray::new([0_u8; 100usize]),
9655 peripherals_metadata_uri: CharArray::new([0_u8; 100usize]),
9656 };
9657 #[cfg(feature = "arbitrary")]
9658 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9659 use arbitrary::{Arbitrary, Unstructured};
9660 let mut buf = [0u8; 1024];
9661 rng.fill_bytes(&mut buf);
9662 let mut unstructured = Unstructured::new(&buf);
9663 Self::arbitrary(&mut unstructured).unwrap_or_default()
9664 }
9665}
9666impl Default for COMPONENT_INFORMATION_DATA {
9667 fn default() -> Self {
9668 Self::DEFAULT.clone()
9669 }
9670}
9671impl MessageData for COMPONENT_INFORMATION_DATA {
9672 type Message = MavMessage;
9673 const ID: u32 = 395u32;
9674 const NAME: &'static str = "COMPONENT_INFORMATION";
9675 const EXTRA_CRC: u8 = 0u8;
9676 const ENCODED_LEN: usize = 212usize;
9677 fn deser(
9678 _version: MavlinkVersion,
9679 __input: &[u8],
9680 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9681 let avail_len = __input.len();
9682 let mut payload_buf = [0; Self::ENCODED_LEN];
9683 let mut buf = if avail_len < Self::ENCODED_LEN {
9684 payload_buf[0..avail_len].copy_from_slice(__input);
9685 Bytes::new(&payload_buf)
9686 } else {
9687 Bytes::new(__input)
9688 };
9689 let mut __struct = Self::default();
9690 __struct.time_boot_ms = buf.get_u32_le()?;
9691 __struct.general_metadata_file_crc = buf.get_u32_le()?;
9692 __struct.peripherals_metadata_file_crc = buf.get_u32_le()?;
9693 let mut tmp = [0_u8; 100usize];
9694 for v in &mut tmp {
9695 *v = buf.get_u8()?;
9696 }
9697 __struct.general_metadata_uri = CharArray::new(tmp);
9698 let mut tmp = [0_u8; 100usize];
9699 for v in &mut tmp {
9700 *v = buf.get_u8()?;
9701 }
9702 __struct.peripherals_metadata_uri = CharArray::new(tmp);
9703 Ok(__struct)
9704 }
9705 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9706 let mut __tmp = BytesMut::new(bytes);
9707 #[allow(clippy::absurd_extreme_comparisons)]
9708 #[allow(unused_comparisons)]
9709 if __tmp.remaining() < Self::ENCODED_LEN {
9710 panic!(
9711 "buffer is too small (need {} bytes, but got {})",
9712 Self::ENCODED_LEN,
9713 __tmp.remaining(),
9714 )
9715 }
9716 __tmp.put_u32_le(self.time_boot_ms);
9717 __tmp.put_u32_le(self.general_metadata_file_crc);
9718 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
9719 for val in &self.general_metadata_uri {
9720 __tmp.put_u8(*val);
9721 }
9722 for val in &self.peripherals_metadata_uri {
9723 __tmp.put_u8(*val);
9724 }
9725 if matches!(version, MavlinkVersion::V2) {
9726 let len = __tmp.len();
9727 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9728 } else {
9729 __tmp.len()
9730 }
9731 }
9732}
9733#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
9734#[doc = ""]
9735#[doc = "ID: 396"]
9736#[derive(Debug, Clone, PartialEq)]
9737#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9738#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9739#[cfg_attr(feature = "ts", derive(TS))]
9740#[cfg_attr(feature = "ts", ts(export))]
9741pub struct COMPONENT_INFORMATION_BASIC_DATA {
9742 #[doc = "Component capability flags"]
9743 pub capabilities: MavProtocolCapability,
9744 #[doc = "Timestamp (time since system boot)."]
9745 pub time_boot_ms: u32,
9746 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
9747 pub time_manufacture_s: u32,
9748 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9749 #[cfg_attr(feature = "ts", ts(type = "string"))]
9750 pub vendor_name: CharArray<32>,
9751 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9752 #[cfg_attr(feature = "ts", ts(type = "string"))]
9753 pub model_name: CharArray<32>,
9754 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9755 #[cfg_attr(feature = "ts", ts(type = "string"))]
9756 pub software_version: CharArray<24>,
9757 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9758 #[cfg_attr(feature = "ts", ts(type = "string"))]
9759 pub hardware_version: CharArray<24>,
9760 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9761 #[cfg_attr(feature = "ts", ts(type = "string"))]
9762 pub serial_number: CharArray<32>,
9763}
9764impl COMPONENT_INFORMATION_BASIC_DATA {
9765 pub const ENCODED_LEN: usize = 160usize;
9766 pub const DEFAULT: Self = Self {
9767 capabilities: MavProtocolCapability::DEFAULT,
9768 time_boot_ms: 0_u32,
9769 time_manufacture_s: 0_u32,
9770 vendor_name: CharArray::new([0_u8; 32usize]),
9771 model_name: CharArray::new([0_u8; 32usize]),
9772 software_version: CharArray::new([0_u8; 24usize]),
9773 hardware_version: CharArray::new([0_u8; 24usize]),
9774 serial_number: CharArray::new([0_u8; 32usize]),
9775 };
9776 #[cfg(feature = "arbitrary")]
9777 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9778 use arbitrary::{Arbitrary, Unstructured};
9779 let mut buf = [0u8; 1024];
9780 rng.fill_bytes(&mut buf);
9781 let mut unstructured = Unstructured::new(&buf);
9782 Self::arbitrary(&mut unstructured).unwrap_or_default()
9783 }
9784}
9785impl Default for COMPONENT_INFORMATION_BASIC_DATA {
9786 fn default() -> Self {
9787 Self::DEFAULT.clone()
9788 }
9789}
9790impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
9791 type Message = MavMessage;
9792 const ID: u32 = 396u32;
9793 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
9794 const EXTRA_CRC: u8 = 50u8;
9795 const ENCODED_LEN: usize = 160usize;
9796 fn deser(
9797 _version: MavlinkVersion,
9798 __input: &[u8],
9799 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9800 let avail_len = __input.len();
9801 let mut payload_buf = [0; Self::ENCODED_LEN];
9802 let mut buf = if avail_len < Self::ENCODED_LEN {
9803 payload_buf[0..avail_len].copy_from_slice(__input);
9804 Bytes::new(&payload_buf)
9805 } else {
9806 Bytes::new(__input)
9807 };
9808 let mut __struct = Self::default();
9809 let tmp = buf.get_u64_le()?;
9810 __struct.capabilities = MavProtocolCapability::from_bits(
9811 tmp as <MavProtocolCapability as Flags>::Bits,
9812 )
9813 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
9814 flag_type: "MavProtocolCapability",
9815 value: tmp as u64,
9816 })?;
9817 __struct.time_boot_ms = buf.get_u32_le()?;
9818 __struct.time_manufacture_s = buf.get_u32_le()?;
9819 let mut tmp = [0_u8; 32usize];
9820 for v in &mut tmp {
9821 *v = buf.get_u8()?;
9822 }
9823 __struct.vendor_name = CharArray::new(tmp);
9824 let mut tmp = [0_u8; 32usize];
9825 for v in &mut tmp {
9826 *v = buf.get_u8()?;
9827 }
9828 __struct.model_name = CharArray::new(tmp);
9829 let mut tmp = [0_u8; 24usize];
9830 for v in &mut tmp {
9831 *v = buf.get_u8()?;
9832 }
9833 __struct.software_version = CharArray::new(tmp);
9834 let mut tmp = [0_u8; 24usize];
9835 for v in &mut tmp {
9836 *v = buf.get_u8()?;
9837 }
9838 __struct.hardware_version = CharArray::new(tmp);
9839 let mut tmp = [0_u8; 32usize];
9840 for v in &mut tmp {
9841 *v = buf.get_u8()?;
9842 }
9843 __struct.serial_number = CharArray::new(tmp);
9844 Ok(__struct)
9845 }
9846 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9847 let mut __tmp = BytesMut::new(bytes);
9848 #[allow(clippy::absurd_extreme_comparisons)]
9849 #[allow(unused_comparisons)]
9850 if __tmp.remaining() < Self::ENCODED_LEN {
9851 panic!(
9852 "buffer is too small (need {} bytes, but got {})",
9853 Self::ENCODED_LEN,
9854 __tmp.remaining(),
9855 )
9856 }
9857 __tmp.put_u64_le(self.capabilities.bits() as u64);
9858 __tmp.put_u32_le(self.time_boot_ms);
9859 __tmp.put_u32_le(self.time_manufacture_s);
9860 for val in &self.vendor_name {
9861 __tmp.put_u8(*val);
9862 }
9863 for val in &self.model_name {
9864 __tmp.put_u8(*val);
9865 }
9866 for val in &self.software_version {
9867 __tmp.put_u8(*val);
9868 }
9869 for val in &self.hardware_version {
9870 __tmp.put_u8(*val);
9871 }
9872 for val in &self.serial_number {
9873 __tmp.put_u8(*val);
9874 }
9875 if matches!(version, MavlinkVersion::V2) {
9876 let len = __tmp.len();
9877 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9878 } else {
9879 __tmp.len()
9880 }
9881 }
9882}
9883#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
9884#[doc = ""]
9885#[doc = "ID: 397"]
9886#[derive(Debug, Clone, PartialEq)]
9887#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9888#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9889#[cfg_attr(feature = "ts", derive(TS))]
9890#[cfg_attr(feature = "ts", ts(export))]
9891pub struct COMPONENT_METADATA_DATA {
9892 #[doc = "Timestamp (time since system boot)."]
9893 pub time_boot_ms: u32,
9894 #[doc = "CRC32 of the general metadata file."]
9895 pub file_crc: u32,
9896 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9897 #[cfg_attr(feature = "ts", ts(type = "string"))]
9898 pub uri: CharArray<100>,
9899}
9900impl COMPONENT_METADATA_DATA {
9901 pub const ENCODED_LEN: usize = 108usize;
9902 pub const DEFAULT: Self = Self {
9903 time_boot_ms: 0_u32,
9904 file_crc: 0_u32,
9905 uri: CharArray::new([0_u8; 100usize]),
9906 };
9907 #[cfg(feature = "arbitrary")]
9908 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9909 use arbitrary::{Arbitrary, Unstructured};
9910 let mut buf = [0u8; 1024];
9911 rng.fill_bytes(&mut buf);
9912 let mut unstructured = Unstructured::new(&buf);
9913 Self::arbitrary(&mut unstructured).unwrap_or_default()
9914 }
9915}
9916impl Default for COMPONENT_METADATA_DATA {
9917 fn default() -> Self {
9918 Self::DEFAULT.clone()
9919 }
9920}
9921impl MessageData for COMPONENT_METADATA_DATA {
9922 type Message = MavMessage;
9923 const ID: u32 = 397u32;
9924 const NAME: &'static str = "COMPONENT_METADATA";
9925 const EXTRA_CRC: u8 = 182u8;
9926 const ENCODED_LEN: usize = 108usize;
9927 fn deser(
9928 _version: MavlinkVersion,
9929 __input: &[u8],
9930 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9931 let avail_len = __input.len();
9932 let mut payload_buf = [0; Self::ENCODED_LEN];
9933 let mut buf = if avail_len < Self::ENCODED_LEN {
9934 payload_buf[0..avail_len].copy_from_slice(__input);
9935 Bytes::new(&payload_buf)
9936 } else {
9937 Bytes::new(__input)
9938 };
9939 let mut __struct = Self::default();
9940 __struct.time_boot_ms = buf.get_u32_le()?;
9941 __struct.file_crc = buf.get_u32_le()?;
9942 let mut tmp = [0_u8; 100usize];
9943 for v in &mut tmp {
9944 *v = buf.get_u8()?;
9945 }
9946 __struct.uri = CharArray::new(tmp);
9947 Ok(__struct)
9948 }
9949 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9950 let mut __tmp = BytesMut::new(bytes);
9951 #[allow(clippy::absurd_extreme_comparisons)]
9952 #[allow(unused_comparisons)]
9953 if __tmp.remaining() < Self::ENCODED_LEN {
9954 panic!(
9955 "buffer is too small (need {} bytes, but got {})",
9956 Self::ENCODED_LEN,
9957 __tmp.remaining(),
9958 )
9959 }
9960 __tmp.put_u32_le(self.time_boot_ms);
9961 __tmp.put_u32_le(self.file_crc);
9962 for val in &self.uri {
9963 __tmp.put_u8(*val);
9964 }
9965 if matches!(version, MavlinkVersion::V2) {
9966 let len = __tmp.len();
9967 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9968 } else {
9969 __tmp.len()
9970 }
9971 }
9972}
9973#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
9974#[doc = ""]
9975#[doc = "ID: 146"]
9976#[derive(Debug, Clone, PartialEq)]
9977#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9978#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9979#[cfg_attr(feature = "ts", derive(TS))]
9980#[cfg_attr(feature = "ts", ts(export))]
9981pub struct CONTROL_SYSTEM_STATE_DATA {
9982 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9983 pub time_usec: u64,
9984 #[doc = "X acceleration in body frame"]
9985 pub x_acc: f32,
9986 #[doc = "Y acceleration in body frame"]
9987 pub y_acc: f32,
9988 #[doc = "Z acceleration in body frame"]
9989 pub z_acc: f32,
9990 #[doc = "X velocity in body frame"]
9991 pub x_vel: f32,
9992 #[doc = "Y velocity in body frame"]
9993 pub y_vel: f32,
9994 #[doc = "Z velocity in body frame"]
9995 pub z_vel: f32,
9996 #[doc = "X position in local frame"]
9997 pub x_pos: f32,
9998 #[doc = "Y position in local frame"]
9999 pub y_pos: f32,
10000 #[doc = "Z position in local frame"]
10001 pub z_pos: f32,
10002 #[doc = "Airspeed, set to -1 if unknown"]
10003 pub airspeed: f32,
10004 #[doc = "Variance of body velocity estimate"]
10005 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10006 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10007 pub vel_variance: [f32; 3],
10008 #[doc = "Variance in local position"]
10009 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10010 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10011 pub pos_variance: [f32; 3],
10012 #[doc = "The attitude, represented as Quaternion"]
10013 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10014 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10015 pub q: [f32; 4],
10016 #[doc = "Angular rate in roll axis"]
10017 pub roll_rate: f32,
10018 #[doc = "Angular rate in pitch axis"]
10019 pub pitch_rate: f32,
10020 #[doc = "Angular rate in yaw axis"]
10021 pub yaw_rate: f32,
10022}
10023impl CONTROL_SYSTEM_STATE_DATA {
10024 pub const ENCODED_LEN: usize = 100usize;
10025 pub const DEFAULT: Self = Self {
10026 time_usec: 0_u64,
10027 x_acc: 0.0_f32,
10028 y_acc: 0.0_f32,
10029 z_acc: 0.0_f32,
10030 x_vel: 0.0_f32,
10031 y_vel: 0.0_f32,
10032 z_vel: 0.0_f32,
10033 x_pos: 0.0_f32,
10034 y_pos: 0.0_f32,
10035 z_pos: 0.0_f32,
10036 airspeed: 0.0_f32,
10037 vel_variance: [0.0_f32; 3usize],
10038 pos_variance: [0.0_f32; 3usize],
10039 q: [0.0_f32; 4usize],
10040 roll_rate: 0.0_f32,
10041 pitch_rate: 0.0_f32,
10042 yaw_rate: 0.0_f32,
10043 };
10044 #[cfg(feature = "arbitrary")]
10045 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10046 use arbitrary::{Arbitrary, Unstructured};
10047 let mut buf = [0u8; 1024];
10048 rng.fill_bytes(&mut buf);
10049 let mut unstructured = Unstructured::new(&buf);
10050 Self::arbitrary(&mut unstructured).unwrap_or_default()
10051 }
10052}
10053impl Default for CONTROL_SYSTEM_STATE_DATA {
10054 fn default() -> Self {
10055 Self::DEFAULT.clone()
10056 }
10057}
10058impl MessageData for CONTROL_SYSTEM_STATE_DATA {
10059 type Message = MavMessage;
10060 const ID: u32 = 146u32;
10061 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
10062 const EXTRA_CRC: u8 = 103u8;
10063 const ENCODED_LEN: usize = 100usize;
10064 fn deser(
10065 _version: MavlinkVersion,
10066 __input: &[u8],
10067 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10068 let avail_len = __input.len();
10069 let mut payload_buf = [0; Self::ENCODED_LEN];
10070 let mut buf = if avail_len < Self::ENCODED_LEN {
10071 payload_buf[0..avail_len].copy_from_slice(__input);
10072 Bytes::new(&payload_buf)
10073 } else {
10074 Bytes::new(__input)
10075 };
10076 let mut __struct = Self::default();
10077 __struct.time_usec = buf.get_u64_le()?;
10078 __struct.x_acc = buf.get_f32_le()?;
10079 __struct.y_acc = buf.get_f32_le()?;
10080 __struct.z_acc = buf.get_f32_le()?;
10081 __struct.x_vel = buf.get_f32_le()?;
10082 __struct.y_vel = buf.get_f32_le()?;
10083 __struct.z_vel = buf.get_f32_le()?;
10084 __struct.x_pos = buf.get_f32_le()?;
10085 __struct.y_pos = buf.get_f32_le()?;
10086 __struct.z_pos = buf.get_f32_le()?;
10087 __struct.airspeed = buf.get_f32_le()?;
10088 for v in &mut __struct.vel_variance {
10089 let val = buf.get_f32_le()?;
10090 *v = val;
10091 }
10092 for v in &mut __struct.pos_variance {
10093 let val = buf.get_f32_le()?;
10094 *v = val;
10095 }
10096 for v in &mut __struct.q {
10097 let val = buf.get_f32_le()?;
10098 *v = val;
10099 }
10100 __struct.roll_rate = buf.get_f32_le()?;
10101 __struct.pitch_rate = buf.get_f32_le()?;
10102 __struct.yaw_rate = buf.get_f32_le()?;
10103 Ok(__struct)
10104 }
10105 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10106 let mut __tmp = BytesMut::new(bytes);
10107 #[allow(clippy::absurd_extreme_comparisons)]
10108 #[allow(unused_comparisons)]
10109 if __tmp.remaining() < Self::ENCODED_LEN {
10110 panic!(
10111 "buffer is too small (need {} bytes, but got {})",
10112 Self::ENCODED_LEN,
10113 __tmp.remaining(),
10114 )
10115 }
10116 __tmp.put_u64_le(self.time_usec);
10117 __tmp.put_f32_le(self.x_acc);
10118 __tmp.put_f32_le(self.y_acc);
10119 __tmp.put_f32_le(self.z_acc);
10120 __tmp.put_f32_le(self.x_vel);
10121 __tmp.put_f32_le(self.y_vel);
10122 __tmp.put_f32_le(self.z_vel);
10123 __tmp.put_f32_le(self.x_pos);
10124 __tmp.put_f32_le(self.y_pos);
10125 __tmp.put_f32_le(self.z_pos);
10126 __tmp.put_f32_le(self.airspeed);
10127 for val in &self.vel_variance {
10128 __tmp.put_f32_le(*val);
10129 }
10130 for val in &self.pos_variance {
10131 __tmp.put_f32_le(*val);
10132 }
10133 for val in &self.q {
10134 __tmp.put_f32_le(*val);
10135 }
10136 __tmp.put_f32_le(self.roll_rate);
10137 __tmp.put_f32_le(self.pitch_rate);
10138 __tmp.put_f32_le(self.yaw_rate);
10139 if matches!(version, MavlinkVersion::V2) {
10140 let len = __tmp.len();
10141 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10142 } else {
10143 __tmp.len()
10144 }
10145 }
10146}
10147#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
10148#[doc = ""]
10149#[doc = "ID: 411"]
10150#[derive(Debug, Clone, PartialEq)]
10151#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10152#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10153#[cfg_attr(feature = "ts", derive(TS))]
10154#[cfg_attr(feature = "ts", ts(export))]
10155pub struct CURRENT_EVENT_SEQUENCE_DATA {
10156 #[doc = "Sequence number."]
10157 pub sequence: u16,
10158 #[doc = "Flag bitset."]
10159 pub flags: MavEventCurrentSequenceFlags,
10160}
10161impl CURRENT_EVENT_SEQUENCE_DATA {
10162 pub const ENCODED_LEN: usize = 3usize;
10163 pub const DEFAULT: Self = Self {
10164 sequence: 0_u16,
10165 flags: MavEventCurrentSequenceFlags::DEFAULT,
10166 };
10167 #[cfg(feature = "arbitrary")]
10168 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10169 use arbitrary::{Arbitrary, Unstructured};
10170 let mut buf = [0u8; 1024];
10171 rng.fill_bytes(&mut buf);
10172 let mut unstructured = Unstructured::new(&buf);
10173 Self::arbitrary(&mut unstructured).unwrap_or_default()
10174 }
10175}
10176impl Default for CURRENT_EVENT_SEQUENCE_DATA {
10177 fn default() -> Self {
10178 Self::DEFAULT.clone()
10179 }
10180}
10181impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
10182 type Message = MavMessage;
10183 const ID: u32 = 411u32;
10184 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
10185 const EXTRA_CRC: u8 = 106u8;
10186 const ENCODED_LEN: usize = 3usize;
10187 fn deser(
10188 _version: MavlinkVersion,
10189 __input: &[u8],
10190 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10191 let avail_len = __input.len();
10192 let mut payload_buf = [0; Self::ENCODED_LEN];
10193 let mut buf = if avail_len < Self::ENCODED_LEN {
10194 payload_buf[0..avail_len].copy_from_slice(__input);
10195 Bytes::new(&payload_buf)
10196 } else {
10197 Bytes::new(__input)
10198 };
10199 let mut __struct = Self::default();
10200 __struct.sequence = buf.get_u16_le()?;
10201 let tmp = buf.get_u8()?;
10202 __struct.flags =
10203 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10204 enum_type: "MavEventCurrentSequenceFlags",
10205 value: tmp as u64,
10206 })?;
10207 Ok(__struct)
10208 }
10209 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10210 let mut __tmp = BytesMut::new(bytes);
10211 #[allow(clippy::absurd_extreme_comparisons)]
10212 #[allow(unused_comparisons)]
10213 if __tmp.remaining() < Self::ENCODED_LEN {
10214 panic!(
10215 "buffer is too small (need {} bytes, but got {})",
10216 Self::ENCODED_LEN,
10217 __tmp.remaining(),
10218 )
10219 }
10220 __tmp.put_u16_le(self.sequence);
10221 __tmp.put_u8(self.flags as u8);
10222 if matches!(version, MavlinkVersion::V2) {
10223 let len = __tmp.len();
10224 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10225 } else {
10226 __tmp.len()
10227 }
10228 }
10229}
10230#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
10231#[doc = ""]
10232#[doc = "ID: 436"]
10233#[derive(Debug, Clone, PartialEq)]
10234#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10235#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10236#[cfg_attr(feature = "ts", derive(TS))]
10237#[cfg_attr(feature = "ts", ts(export))]
10238pub struct CURRENT_MODE_DATA {
10239 #[doc = "A bitfield for use for autopilot-specific flags"]
10240 pub custom_mode: u32,
10241 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
10242 pub intended_custom_mode: u32,
10243 #[doc = "Standard mode."]
10244 pub standard_mode: MavStandardMode,
10245}
10246impl CURRENT_MODE_DATA {
10247 pub const ENCODED_LEN: usize = 9usize;
10248 pub const DEFAULT: Self = Self {
10249 custom_mode: 0_u32,
10250 intended_custom_mode: 0_u32,
10251 standard_mode: MavStandardMode::DEFAULT,
10252 };
10253 #[cfg(feature = "arbitrary")]
10254 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10255 use arbitrary::{Arbitrary, Unstructured};
10256 let mut buf = [0u8; 1024];
10257 rng.fill_bytes(&mut buf);
10258 let mut unstructured = Unstructured::new(&buf);
10259 Self::arbitrary(&mut unstructured).unwrap_or_default()
10260 }
10261}
10262impl Default for CURRENT_MODE_DATA {
10263 fn default() -> Self {
10264 Self::DEFAULT.clone()
10265 }
10266}
10267impl MessageData for CURRENT_MODE_DATA {
10268 type Message = MavMessage;
10269 const ID: u32 = 436u32;
10270 const NAME: &'static str = "CURRENT_MODE";
10271 const EXTRA_CRC: u8 = 193u8;
10272 const ENCODED_LEN: usize = 9usize;
10273 fn deser(
10274 _version: MavlinkVersion,
10275 __input: &[u8],
10276 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10277 let avail_len = __input.len();
10278 let mut payload_buf = [0; Self::ENCODED_LEN];
10279 let mut buf = if avail_len < Self::ENCODED_LEN {
10280 payload_buf[0..avail_len].copy_from_slice(__input);
10281 Bytes::new(&payload_buf)
10282 } else {
10283 Bytes::new(__input)
10284 };
10285 let mut __struct = Self::default();
10286 __struct.custom_mode = buf.get_u32_le()?;
10287 __struct.intended_custom_mode = buf.get_u32_le()?;
10288 let tmp = buf.get_u8()?;
10289 __struct.standard_mode =
10290 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10291 enum_type: "MavStandardMode",
10292 value: tmp as u64,
10293 })?;
10294 Ok(__struct)
10295 }
10296 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10297 let mut __tmp = BytesMut::new(bytes);
10298 #[allow(clippy::absurd_extreme_comparisons)]
10299 #[allow(unused_comparisons)]
10300 if __tmp.remaining() < Self::ENCODED_LEN {
10301 panic!(
10302 "buffer is too small (need {} bytes, but got {})",
10303 Self::ENCODED_LEN,
10304 __tmp.remaining(),
10305 )
10306 }
10307 __tmp.put_u32_le(self.custom_mode);
10308 __tmp.put_u32_le(self.intended_custom_mode);
10309 __tmp.put_u8(self.standard_mode as u8);
10310 if matches!(version, MavlinkVersion::V2) {
10311 let len = __tmp.len();
10312 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10313 } else {
10314 __tmp.len()
10315 }
10316 }
10317}
10318#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
10319#[doc = "Data stream status information."]
10320#[doc = ""]
10321#[doc = "ID: 67"]
10322#[derive(Debug, Clone, PartialEq)]
10323#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10324#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10325#[cfg_attr(feature = "ts", derive(TS))]
10326#[cfg_attr(feature = "ts", ts(export))]
10327pub struct DATA_STREAM_DATA {
10328 #[doc = "The message rate"]
10329 pub message_rate: u16,
10330 #[doc = "The ID of the requested data stream"]
10331 pub stream_id: u8,
10332 #[doc = "1 stream is enabled, 0 stream is stopped."]
10333 pub on_off: u8,
10334}
10335impl DATA_STREAM_DATA {
10336 pub const ENCODED_LEN: usize = 4usize;
10337 pub const DEFAULT: Self = Self {
10338 message_rate: 0_u16,
10339 stream_id: 0_u8,
10340 on_off: 0_u8,
10341 };
10342 #[cfg(feature = "arbitrary")]
10343 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10344 use arbitrary::{Arbitrary, Unstructured};
10345 let mut buf = [0u8; 1024];
10346 rng.fill_bytes(&mut buf);
10347 let mut unstructured = Unstructured::new(&buf);
10348 Self::arbitrary(&mut unstructured).unwrap_or_default()
10349 }
10350}
10351impl Default for DATA_STREAM_DATA {
10352 fn default() -> Self {
10353 Self::DEFAULT.clone()
10354 }
10355}
10356impl MessageData for DATA_STREAM_DATA {
10357 type Message = MavMessage;
10358 const ID: u32 = 67u32;
10359 const NAME: &'static str = "DATA_STREAM";
10360 const EXTRA_CRC: u8 = 21u8;
10361 const ENCODED_LEN: usize = 4usize;
10362 fn deser(
10363 _version: MavlinkVersion,
10364 __input: &[u8],
10365 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10366 let avail_len = __input.len();
10367 let mut payload_buf = [0; Self::ENCODED_LEN];
10368 let mut buf = if avail_len < Self::ENCODED_LEN {
10369 payload_buf[0..avail_len].copy_from_slice(__input);
10370 Bytes::new(&payload_buf)
10371 } else {
10372 Bytes::new(__input)
10373 };
10374 let mut __struct = Self::default();
10375 __struct.message_rate = buf.get_u16_le()?;
10376 __struct.stream_id = buf.get_u8()?;
10377 __struct.on_off = buf.get_u8()?;
10378 Ok(__struct)
10379 }
10380 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10381 let mut __tmp = BytesMut::new(bytes);
10382 #[allow(clippy::absurd_extreme_comparisons)]
10383 #[allow(unused_comparisons)]
10384 if __tmp.remaining() < Self::ENCODED_LEN {
10385 panic!(
10386 "buffer is too small (need {} bytes, but got {})",
10387 Self::ENCODED_LEN,
10388 __tmp.remaining(),
10389 )
10390 }
10391 __tmp.put_u16_le(self.message_rate);
10392 __tmp.put_u8(self.stream_id);
10393 __tmp.put_u8(self.on_off);
10394 if matches!(version, MavlinkVersion::V2) {
10395 let len = __tmp.len();
10396 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10397 } else {
10398 __tmp.len()
10399 }
10400 }
10401}
10402#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10403#[doc = ""]
10404#[doc = "ID: 130"]
10405#[derive(Debug, Clone, PartialEq)]
10406#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10408#[cfg_attr(feature = "ts", derive(TS))]
10409#[cfg_attr(feature = "ts", ts(export))]
10410pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
10411 #[doc = "total data size (set on ACK only)."]
10412 pub size: u32,
10413 #[doc = "Width of a matrix or image."]
10414 pub width: u16,
10415 #[doc = "Height of a matrix or image."]
10416 pub height: u16,
10417 #[doc = "Number of packets being sent (set on ACK only)."]
10418 pub packets: u16,
10419 #[doc = "Type of requested/acknowledged data."]
10420 pub mavtype: MavlinkDataStreamType,
10421 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
10422 pub payload: u8,
10423 #[doc = "JPEG quality. Values: [1-100]."]
10424 pub jpg_quality: u8,
10425}
10426impl DATA_TRANSMISSION_HANDSHAKE_DATA {
10427 pub const ENCODED_LEN: usize = 13usize;
10428 pub const DEFAULT: Self = Self {
10429 size: 0_u32,
10430 width: 0_u16,
10431 height: 0_u16,
10432 packets: 0_u16,
10433 mavtype: MavlinkDataStreamType::DEFAULT,
10434 payload: 0_u8,
10435 jpg_quality: 0_u8,
10436 };
10437 #[cfg(feature = "arbitrary")]
10438 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10439 use arbitrary::{Arbitrary, Unstructured};
10440 let mut buf = [0u8; 1024];
10441 rng.fill_bytes(&mut buf);
10442 let mut unstructured = Unstructured::new(&buf);
10443 Self::arbitrary(&mut unstructured).unwrap_or_default()
10444 }
10445}
10446impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
10447 fn default() -> Self {
10448 Self::DEFAULT.clone()
10449 }
10450}
10451impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
10452 type Message = MavMessage;
10453 const ID: u32 = 130u32;
10454 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
10455 const EXTRA_CRC: u8 = 29u8;
10456 const ENCODED_LEN: usize = 13usize;
10457 fn deser(
10458 _version: MavlinkVersion,
10459 __input: &[u8],
10460 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10461 let avail_len = __input.len();
10462 let mut payload_buf = [0; Self::ENCODED_LEN];
10463 let mut buf = if avail_len < Self::ENCODED_LEN {
10464 payload_buf[0..avail_len].copy_from_slice(__input);
10465 Bytes::new(&payload_buf)
10466 } else {
10467 Bytes::new(__input)
10468 };
10469 let mut __struct = Self::default();
10470 __struct.size = buf.get_u32_le()?;
10471 __struct.width = buf.get_u16_le()?;
10472 __struct.height = buf.get_u16_le()?;
10473 __struct.packets = buf.get_u16_le()?;
10474 let tmp = buf.get_u8()?;
10475 __struct.mavtype =
10476 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10477 enum_type: "MavlinkDataStreamType",
10478 value: tmp as u64,
10479 })?;
10480 __struct.payload = buf.get_u8()?;
10481 __struct.jpg_quality = buf.get_u8()?;
10482 Ok(__struct)
10483 }
10484 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10485 let mut __tmp = BytesMut::new(bytes);
10486 #[allow(clippy::absurd_extreme_comparisons)]
10487 #[allow(unused_comparisons)]
10488 if __tmp.remaining() < Self::ENCODED_LEN {
10489 panic!(
10490 "buffer is too small (need {} bytes, but got {})",
10491 Self::ENCODED_LEN,
10492 __tmp.remaining(),
10493 )
10494 }
10495 __tmp.put_u32_le(self.size);
10496 __tmp.put_u16_le(self.width);
10497 __tmp.put_u16_le(self.height);
10498 __tmp.put_u16_le(self.packets);
10499 __tmp.put_u8(self.mavtype as u8);
10500 __tmp.put_u8(self.payload);
10501 __tmp.put_u8(self.jpg_quality);
10502 if matches!(version, MavlinkVersion::V2) {
10503 let len = __tmp.len();
10504 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10505 } else {
10506 __tmp.len()
10507 }
10508 }
10509}
10510#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
10511#[doc = ""]
10512#[doc = "ID: 254"]
10513#[derive(Debug, Clone, PartialEq)]
10514#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10515#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10516#[cfg_attr(feature = "ts", derive(TS))]
10517#[cfg_attr(feature = "ts", ts(export))]
10518pub struct DEBUG_DATA {
10519 #[doc = "Timestamp (time since system boot)."]
10520 pub time_boot_ms: u32,
10521 #[doc = "DEBUG value"]
10522 pub value: f32,
10523 #[doc = "index of debug variable"]
10524 pub ind: u8,
10525}
10526impl DEBUG_DATA {
10527 pub const ENCODED_LEN: usize = 9usize;
10528 pub const DEFAULT: Self = Self {
10529 time_boot_ms: 0_u32,
10530 value: 0.0_f32,
10531 ind: 0_u8,
10532 };
10533 #[cfg(feature = "arbitrary")]
10534 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10535 use arbitrary::{Arbitrary, Unstructured};
10536 let mut buf = [0u8; 1024];
10537 rng.fill_bytes(&mut buf);
10538 let mut unstructured = Unstructured::new(&buf);
10539 Self::arbitrary(&mut unstructured).unwrap_or_default()
10540 }
10541}
10542impl Default for DEBUG_DATA {
10543 fn default() -> Self {
10544 Self::DEFAULT.clone()
10545 }
10546}
10547impl MessageData for DEBUG_DATA {
10548 type Message = MavMessage;
10549 const ID: u32 = 254u32;
10550 const NAME: &'static str = "DEBUG";
10551 const EXTRA_CRC: u8 = 46u8;
10552 const ENCODED_LEN: usize = 9usize;
10553 fn deser(
10554 _version: MavlinkVersion,
10555 __input: &[u8],
10556 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10557 let avail_len = __input.len();
10558 let mut payload_buf = [0; Self::ENCODED_LEN];
10559 let mut buf = if avail_len < Self::ENCODED_LEN {
10560 payload_buf[0..avail_len].copy_from_slice(__input);
10561 Bytes::new(&payload_buf)
10562 } else {
10563 Bytes::new(__input)
10564 };
10565 let mut __struct = Self::default();
10566 __struct.time_boot_ms = buf.get_u32_le()?;
10567 __struct.value = buf.get_f32_le()?;
10568 __struct.ind = buf.get_u8()?;
10569 Ok(__struct)
10570 }
10571 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10572 let mut __tmp = BytesMut::new(bytes);
10573 #[allow(clippy::absurd_extreme_comparisons)]
10574 #[allow(unused_comparisons)]
10575 if __tmp.remaining() < Self::ENCODED_LEN {
10576 panic!(
10577 "buffer is too small (need {} bytes, but got {})",
10578 Self::ENCODED_LEN,
10579 __tmp.remaining(),
10580 )
10581 }
10582 __tmp.put_u32_le(self.time_boot_ms);
10583 __tmp.put_f32_le(self.value);
10584 __tmp.put_u8(self.ind);
10585 if matches!(version, MavlinkVersion::V2) {
10586 let len = __tmp.len();
10587 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10588 } else {
10589 __tmp.len()
10590 }
10591 }
10592}
10593#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
10594#[doc = ""]
10595#[doc = "ID: 350"]
10596#[derive(Debug, Clone, PartialEq)]
10597#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10598#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10599#[cfg_attr(feature = "ts", derive(TS))]
10600#[cfg_attr(feature = "ts", ts(export))]
10601pub struct DEBUG_FLOAT_ARRAY_DATA {
10602 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10603 pub time_usec: u64,
10604 #[doc = "Unique ID used to discriminate between arrays"]
10605 pub array_id: u16,
10606 #[doc = "Name, for human-friendly display in a Ground Control Station"]
10607 #[cfg_attr(feature = "ts", ts(type = "string"))]
10608 pub name: CharArray<10>,
10609 #[doc = "data"]
10610 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10611 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10612 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10613 pub data: [f32; 58],
10614}
10615impl DEBUG_FLOAT_ARRAY_DATA {
10616 pub const ENCODED_LEN: usize = 252usize;
10617 pub const DEFAULT: Self = Self {
10618 time_usec: 0_u64,
10619 array_id: 0_u16,
10620 name: CharArray::new([0_u8; 10usize]),
10621 data: [0.0_f32; 58usize],
10622 };
10623 #[cfg(feature = "arbitrary")]
10624 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10625 use arbitrary::{Arbitrary, Unstructured};
10626 let mut buf = [0u8; 1024];
10627 rng.fill_bytes(&mut buf);
10628 let mut unstructured = Unstructured::new(&buf);
10629 Self::arbitrary(&mut unstructured).unwrap_or_default()
10630 }
10631}
10632impl Default for DEBUG_FLOAT_ARRAY_DATA {
10633 fn default() -> Self {
10634 Self::DEFAULT.clone()
10635 }
10636}
10637impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
10638 type Message = MavMessage;
10639 const ID: u32 = 350u32;
10640 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
10641 const EXTRA_CRC: u8 = 232u8;
10642 const ENCODED_LEN: usize = 252usize;
10643 fn deser(
10644 _version: MavlinkVersion,
10645 __input: &[u8],
10646 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10647 let avail_len = __input.len();
10648 let mut payload_buf = [0; Self::ENCODED_LEN];
10649 let mut buf = if avail_len < Self::ENCODED_LEN {
10650 payload_buf[0..avail_len].copy_from_slice(__input);
10651 Bytes::new(&payload_buf)
10652 } else {
10653 Bytes::new(__input)
10654 };
10655 let mut __struct = Self::default();
10656 __struct.time_usec = buf.get_u64_le()?;
10657 __struct.array_id = buf.get_u16_le()?;
10658 let mut tmp = [0_u8; 10usize];
10659 for v in &mut tmp {
10660 *v = buf.get_u8()?;
10661 }
10662 __struct.name = CharArray::new(tmp);
10663 for v in &mut __struct.data {
10664 let val = buf.get_f32_le()?;
10665 *v = val;
10666 }
10667 Ok(__struct)
10668 }
10669 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10670 let mut __tmp = BytesMut::new(bytes);
10671 #[allow(clippy::absurd_extreme_comparisons)]
10672 #[allow(unused_comparisons)]
10673 if __tmp.remaining() < Self::ENCODED_LEN {
10674 panic!(
10675 "buffer is too small (need {} bytes, but got {})",
10676 Self::ENCODED_LEN,
10677 __tmp.remaining(),
10678 )
10679 }
10680 __tmp.put_u64_le(self.time_usec);
10681 __tmp.put_u16_le(self.array_id);
10682 for val in &self.name {
10683 __tmp.put_u8(*val);
10684 }
10685 if matches!(version, MavlinkVersion::V2) {
10686 for val in &self.data {
10687 __tmp.put_f32_le(*val);
10688 }
10689 let len = __tmp.len();
10690 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10691 } else {
10692 __tmp.len()
10693 }
10694 }
10695}
10696#[doc = "To debug something using a named 3D vector."]
10697#[doc = ""]
10698#[doc = "ID: 250"]
10699#[derive(Debug, Clone, PartialEq)]
10700#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10701#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10702#[cfg_attr(feature = "ts", derive(TS))]
10703#[cfg_attr(feature = "ts", ts(export))]
10704pub struct DEBUG_VECT_DATA {
10705 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10706 pub time_usec: u64,
10707 #[doc = "x"]
10708 pub x: f32,
10709 #[doc = "y"]
10710 pub y: f32,
10711 #[doc = "z"]
10712 pub z: f32,
10713 #[doc = "Name"]
10714 #[cfg_attr(feature = "ts", ts(type = "string"))]
10715 pub name: CharArray<10>,
10716}
10717impl DEBUG_VECT_DATA {
10718 pub const ENCODED_LEN: usize = 30usize;
10719 pub const DEFAULT: Self = Self {
10720 time_usec: 0_u64,
10721 x: 0.0_f32,
10722 y: 0.0_f32,
10723 z: 0.0_f32,
10724 name: CharArray::new([0_u8; 10usize]),
10725 };
10726 #[cfg(feature = "arbitrary")]
10727 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10728 use arbitrary::{Arbitrary, Unstructured};
10729 let mut buf = [0u8; 1024];
10730 rng.fill_bytes(&mut buf);
10731 let mut unstructured = Unstructured::new(&buf);
10732 Self::arbitrary(&mut unstructured).unwrap_or_default()
10733 }
10734}
10735impl Default for DEBUG_VECT_DATA {
10736 fn default() -> Self {
10737 Self::DEFAULT.clone()
10738 }
10739}
10740impl MessageData for DEBUG_VECT_DATA {
10741 type Message = MavMessage;
10742 const ID: u32 = 250u32;
10743 const NAME: &'static str = "DEBUG_VECT";
10744 const EXTRA_CRC: u8 = 49u8;
10745 const ENCODED_LEN: usize = 30usize;
10746 fn deser(
10747 _version: MavlinkVersion,
10748 __input: &[u8],
10749 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10750 let avail_len = __input.len();
10751 let mut payload_buf = [0; Self::ENCODED_LEN];
10752 let mut buf = if avail_len < Self::ENCODED_LEN {
10753 payload_buf[0..avail_len].copy_from_slice(__input);
10754 Bytes::new(&payload_buf)
10755 } else {
10756 Bytes::new(__input)
10757 };
10758 let mut __struct = Self::default();
10759 __struct.time_usec = buf.get_u64_le()?;
10760 __struct.x = buf.get_f32_le()?;
10761 __struct.y = buf.get_f32_le()?;
10762 __struct.z = buf.get_f32_le()?;
10763 let mut tmp = [0_u8; 10usize];
10764 for v in &mut tmp {
10765 *v = buf.get_u8()?;
10766 }
10767 __struct.name = CharArray::new(tmp);
10768 Ok(__struct)
10769 }
10770 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10771 let mut __tmp = BytesMut::new(bytes);
10772 #[allow(clippy::absurd_extreme_comparisons)]
10773 #[allow(unused_comparisons)]
10774 if __tmp.remaining() < Self::ENCODED_LEN {
10775 panic!(
10776 "buffer is too small (need {} bytes, but got {})",
10777 Self::ENCODED_LEN,
10778 __tmp.remaining(),
10779 )
10780 }
10781 __tmp.put_u64_le(self.time_usec);
10782 __tmp.put_f32_le(self.x);
10783 __tmp.put_f32_le(self.y);
10784 __tmp.put_f32_le(self.z);
10785 for val in &self.name {
10786 __tmp.put_u8(*val);
10787 }
10788 if matches!(version, MavlinkVersion::V2) {
10789 let len = __tmp.len();
10790 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10791 } else {
10792 __tmp.len()
10793 }
10794 }
10795}
10796#[doc = "Distance sensor information for an onboard rangefinder."]
10797#[doc = ""]
10798#[doc = "ID: 132"]
10799#[derive(Debug, Clone, PartialEq)]
10800#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10801#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10802#[cfg_attr(feature = "ts", derive(TS))]
10803#[cfg_attr(feature = "ts", ts(export))]
10804pub struct DISTANCE_SENSOR_DATA {
10805 #[doc = "Timestamp (time since system boot)."]
10806 pub time_boot_ms: u32,
10807 #[doc = "Minimum distance the sensor can measure"]
10808 pub min_distance: u16,
10809 #[doc = "Maximum distance the sensor can measure"]
10810 pub max_distance: u16,
10811 #[doc = "Current distance reading"]
10812 pub current_distance: u16,
10813 #[doc = "Type of distance sensor."]
10814 pub mavtype: MavDistanceSensor,
10815 #[doc = "Onboard ID of the sensor"]
10816 pub id: u8,
10817 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
10818 pub orientation: MavSensorOrientation,
10819 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
10820 pub covariance: u8,
10821 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10822 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10823 pub horizontal_fov: f32,
10824 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10825 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10826 pub vertical_fov: f32,
10827 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
10828 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10829 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10830 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10831 pub quaternion: [f32; 4],
10832 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
10833 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10834 pub signal_quality: u8,
10835}
10836impl DISTANCE_SENSOR_DATA {
10837 pub const ENCODED_LEN: usize = 39usize;
10838 pub const DEFAULT: Self = Self {
10839 time_boot_ms: 0_u32,
10840 min_distance: 0_u16,
10841 max_distance: 0_u16,
10842 current_distance: 0_u16,
10843 mavtype: MavDistanceSensor::DEFAULT,
10844 id: 0_u8,
10845 orientation: MavSensorOrientation::DEFAULT,
10846 covariance: 0_u8,
10847 horizontal_fov: 0.0_f32,
10848 vertical_fov: 0.0_f32,
10849 quaternion: [0.0_f32; 4usize],
10850 signal_quality: 0_u8,
10851 };
10852 #[cfg(feature = "arbitrary")]
10853 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10854 use arbitrary::{Arbitrary, Unstructured};
10855 let mut buf = [0u8; 1024];
10856 rng.fill_bytes(&mut buf);
10857 let mut unstructured = Unstructured::new(&buf);
10858 Self::arbitrary(&mut unstructured).unwrap_or_default()
10859 }
10860}
10861impl Default for DISTANCE_SENSOR_DATA {
10862 fn default() -> Self {
10863 Self::DEFAULT.clone()
10864 }
10865}
10866impl MessageData for DISTANCE_SENSOR_DATA {
10867 type Message = MavMessage;
10868 const ID: u32 = 132u32;
10869 const NAME: &'static str = "DISTANCE_SENSOR";
10870 const EXTRA_CRC: u8 = 85u8;
10871 const ENCODED_LEN: usize = 39usize;
10872 fn deser(
10873 _version: MavlinkVersion,
10874 __input: &[u8],
10875 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10876 let avail_len = __input.len();
10877 let mut payload_buf = [0; Self::ENCODED_LEN];
10878 let mut buf = if avail_len < Self::ENCODED_LEN {
10879 payload_buf[0..avail_len].copy_from_slice(__input);
10880 Bytes::new(&payload_buf)
10881 } else {
10882 Bytes::new(__input)
10883 };
10884 let mut __struct = Self::default();
10885 __struct.time_boot_ms = buf.get_u32_le()?;
10886 __struct.min_distance = buf.get_u16_le()?;
10887 __struct.max_distance = buf.get_u16_le()?;
10888 __struct.current_distance = buf.get_u16_le()?;
10889 let tmp = buf.get_u8()?;
10890 __struct.mavtype =
10891 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10892 enum_type: "MavDistanceSensor",
10893 value: tmp as u64,
10894 })?;
10895 __struct.id = buf.get_u8()?;
10896 let tmp = buf.get_u8()?;
10897 __struct.orientation =
10898 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10899 enum_type: "MavSensorOrientation",
10900 value: tmp as u64,
10901 })?;
10902 __struct.covariance = buf.get_u8()?;
10903 __struct.horizontal_fov = buf.get_f32_le()?;
10904 __struct.vertical_fov = buf.get_f32_le()?;
10905 for v in &mut __struct.quaternion {
10906 let val = buf.get_f32_le()?;
10907 *v = val;
10908 }
10909 __struct.signal_quality = buf.get_u8()?;
10910 Ok(__struct)
10911 }
10912 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10913 let mut __tmp = BytesMut::new(bytes);
10914 #[allow(clippy::absurd_extreme_comparisons)]
10915 #[allow(unused_comparisons)]
10916 if __tmp.remaining() < Self::ENCODED_LEN {
10917 panic!(
10918 "buffer is too small (need {} bytes, but got {})",
10919 Self::ENCODED_LEN,
10920 __tmp.remaining(),
10921 )
10922 }
10923 __tmp.put_u32_le(self.time_boot_ms);
10924 __tmp.put_u16_le(self.min_distance);
10925 __tmp.put_u16_le(self.max_distance);
10926 __tmp.put_u16_le(self.current_distance);
10927 __tmp.put_u8(self.mavtype as u8);
10928 __tmp.put_u8(self.id);
10929 __tmp.put_u8(self.orientation as u8);
10930 __tmp.put_u8(self.covariance);
10931 if matches!(version, MavlinkVersion::V2) {
10932 __tmp.put_f32_le(self.horizontal_fov);
10933 __tmp.put_f32_le(self.vertical_fov);
10934 for val in &self.quaternion {
10935 __tmp.put_f32_le(*val);
10936 }
10937 __tmp.put_u8(self.signal_quality);
10938 let len = __tmp.len();
10939 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10940 } else {
10941 __tmp.len()
10942 }
10943 }
10944}
10945#[doc = "EFI status output."]
10946#[doc = ""]
10947#[doc = "ID: 225"]
10948#[derive(Debug, Clone, PartialEq)]
10949#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10950#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10951#[cfg_attr(feature = "ts", derive(TS))]
10952#[cfg_attr(feature = "ts", ts(export))]
10953pub struct EFI_STATUS_DATA {
10954 #[doc = "ECU index"]
10955 pub ecu_index: f32,
10956 #[doc = "RPM"]
10957 pub rpm: f32,
10958 #[doc = "Fuel consumed"]
10959 pub fuel_consumed: f32,
10960 #[doc = "Fuel flow rate"]
10961 pub fuel_flow: f32,
10962 #[doc = "Engine load"]
10963 pub engine_load: f32,
10964 #[doc = "Throttle position"]
10965 pub throttle_position: f32,
10966 #[doc = "Spark dwell time"]
10967 pub spark_dwell_time: f32,
10968 #[doc = "Barometric pressure"]
10969 pub barometric_pressure: f32,
10970 #[doc = "Intake manifold pressure("]
10971 pub intake_manifold_pressure: f32,
10972 #[doc = "Intake manifold temperature"]
10973 pub intake_manifold_temperature: f32,
10974 #[doc = "Cylinder head temperature"]
10975 pub cylinder_head_temperature: f32,
10976 #[doc = "Ignition timing (Crank angle degrees)"]
10977 pub ignition_timing: f32,
10978 #[doc = "Injection time"]
10979 pub injection_time: f32,
10980 #[doc = "Exhaust gas temperature"]
10981 pub exhaust_gas_temperature: f32,
10982 #[doc = "Output throttle"]
10983 pub throttle_out: f32,
10984 #[doc = "Pressure/temperature compensation"]
10985 pub pt_compensation: f32,
10986 #[doc = "EFI health status"]
10987 pub health: u8,
10988 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
10989 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10990 pub ignition_voltage: f32,
10991 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
10992 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10993 pub fuel_pressure: f32,
10994}
10995impl EFI_STATUS_DATA {
10996 pub const ENCODED_LEN: usize = 73usize;
10997 pub const DEFAULT: Self = Self {
10998 ecu_index: 0.0_f32,
10999 rpm: 0.0_f32,
11000 fuel_consumed: 0.0_f32,
11001 fuel_flow: 0.0_f32,
11002 engine_load: 0.0_f32,
11003 throttle_position: 0.0_f32,
11004 spark_dwell_time: 0.0_f32,
11005 barometric_pressure: 0.0_f32,
11006 intake_manifold_pressure: 0.0_f32,
11007 intake_manifold_temperature: 0.0_f32,
11008 cylinder_head_temperature: 0.0_f32,
11009 ignition_timing: 0.0_f32,
11010 injection_time: 0.0_f32,
11011 exhaust_gas_temperature: 0.0_f32,
11012 throttle_out: 0.0_f32,
11013 pt_compensation: 0.0_f32,
11014 health: 0_u8,
11015 ignition_voltage: 0.0_f32,
11016 fuel_pressure: 0.0_f32,
11017 };
11018 #[cfg(feature = "arbitrary")]
11019 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11020 use arbitrary::{Arbitrary, Unstructured};
11021 let mut buf = [0u8; 1024];
11022 rng.fill_bytes(&mut buf);
11023 let mut unstructured = Unstructured::new(&buf);
11024 Self::arbitrary(&mut unstructured).unwrap_or_default()
11025 }
11026}
11027impl Default for EFI_STATUS_DATA {
11028 fn default() -> Self {
11029 Self::DEFAULT.clone()
11030 }
11031}
11032impl MessageData for EFI_STATUS_DATA {
11033 type Message = MavMessage;
11034 const ID: u32 = 225u32;
11035 const NAME: &'static str = "EFI_STATUS";
11036 const EXTRA_CRC: u8 = 208u8;
11037 const ENCODED_LEN: usize = 73usize;
11038 fn deser(
11039 _version: MavlinkVersion,
11040 __input: &[u8],
11041 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11042 let avail_len = __input.len();
11043 let mut payload_buf = [0; Self::ENCODED_LEN];
11044 let mut buf = if avail_len < Self::ENCODED_LEN {
11045 payload_buf[0..avail_len].copy_from_slice(__input);
11046 Bytes::new(&payload_buf)
11047 } else {
11048 Bytes::new(__input)
11049 };
11050 let mut __struct = Self::default();
11051 __struct.ecu_index = buf.get_f32_le()?;
11052 __struct.rpm = buf.get_f32_le()?;
11053 __struct.fuel_consumed = buf.get_f32_le()?;
11054 __struct.fuel_flow = buf.get_f32_le()?;
11055 __struct.engine_load = buf.get_f32_le()?;
11056 __struct.throttle_position = buf.get_f32_le()?;
11057 __struct.spark_dwell_time = buf.get_f32_le()?;
11058 __struct.barometric_pressure = buf.get_f32_le()?;
11059 __struct.intake_manifold_pressure = buf.get_f32_le()?;
11060 __struct.intake_manifold_temperature = buf.get_f32_le()?;
11061 __struct.cylinder_head_temperature = buf.get_f32_le()?;
11062 __struct.ignition_timing = buf.get_f32_le()?;
11063 __struct.injection_time = buf.get_f32_le()?;
11064 __struct.exhaust_gas_temperature = buf.get_f32_le()?;
11065 __struct.throttle_out = buf.get_f32_le()?;
11066 __struct.pt_compensation = buf.get_f32_le()?;
11067 __struct.health = buf.get_u8()?;
11068 __struct.ignition_voltage = buf.get_f32_le()?;
11069 __struct.fuel_pressure = buf.get_f32_le()?;
11070 Ok(__struct)
11071 }
11072 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11073 let mut __tmp = BytesMut::new(bytes);
11074 #[allow(clippy::absurd_extreme_comparisons)]
11075 #[allow(unused_comparisons)]
11076 if __tmp.remaining() < Self::ENCODED_LEN {
11077 panic!(
11078 "buffer is too small (need {} bytes, but got {})",
11079 Self::ENCODED_LEN,
11080 __tmp.remaining(),
11081 )
11082 }
11083 __tmp.put_f32_le(self.ecu_index);
11084 __tmp.put_f32_le(self.rpm);
11085 __tmp.put_f32_le(self.fuel_consumed);
11086 __tmp.put_f32_le(self.fuel_flow);
11087 __tmp.put_f32_le(self.engine_load);
11088 __tmp.put_f32_le(self.throttle_position);
11089 __tmp.put_f32_le(self.spark_dwell_time);
11090 __tmp.put_f32_le(self.barometric_pressure);
11091 __tmp.put_f32_le(self.intake_manifold_pressure);
11092 __tmp.put_f32_le(self.intake_manifold_temperature);
11093 __tmp.put_f32_le(self.cylinder_head_temperature);
11094 __tmp.put_f32_le(self.ignition_timing);
11095 __tmp.put_f32_le(self.injection_time);
11096 __tmp.put_f32_le(self.exhaust_gas_temperature);
11097 __tmp.put_f32_le(self.throttle_out);
11098 __tmp.put_f32_le(self.pt_compensation);
11099 __tmp.put_u8(self.health);
11100 if matches!(version, MavlinkVersion::V2) {
11101 __tmp.put_f32_le(self.ignition_voltage);
11102 __tmp.put_f32_le(self.fuel_pressure);
11103 let len = __tmp.len();
11104 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11105 } else {
11106 __tmp.len()
11107 }
11108 }
11109}
11110#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
11111#[doc = ""]
11112#[doc = "ID: 131"]
11113#[derive(Debug, Clone, PartialEq)]
11114#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11115#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11116#[cfg_attr(feature = "ts", derive(TS))]
11117#[cfg_attr(feature = "ts", ts(export))]
11118pub struct ENCAPSULATED_DATA_DATA {
11119 #[doc = "sequence number (starting with 0 on every transmission)"]
11120 pub seqnr: u16,
11121 #[doc = "image data bytes"]
11122 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11123 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11124 pub data: [u8; 253],
11125}
11126impl ENCAPSULATED_DATA_DATA {
11127 pub const ENCODED_LEN: usize = 255usize;
11128 pub const DEFAULT: Self = Self {
11129 seqnr: 0_u16,
11130 data: [0_u8; 253usize],
11131 };
11132 #[cfg(feature = "arbitrary")]
11133 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11134 use arbitrary::{Arbitrary, Unstructured};
11135 let mut buf = [0u8; 1024];
11136 rng.fill_bytes(&mut buf);
11137 let mut unstructured = Unstructured::new(&buf);
11138 Self::arbitrary(&mut unstructured).unwrap_or_default()
11139 }
11140}
11141impl Default for ENCAPSULATED_DATA_DATA {
11142 fn default() -> Self {
11143 Self::DEFAULT.clone()
11144 }
11145}
11146impl MessageData for ENCAPSULATED_DATA_DATA {
11147 type Message = MavMessage;
11148 const ID: u32 = 131u32;
11149 const NAME: &'static str = "ENCAPSULATED_DATA";
11150 const EXTRA_CRC: u8 = 223u8;
11151 const ENCODED_LEN: usize = 255usize;
11152 fn deser(
11153 _version: MavlinkVersion,
11154 __input: &[u8],
11155 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11156 let avail_len = __input.len();
11157 let mut payload_buf = [0; Self::ENCODED_LEN];
11158 let mut buf = if avail_len < Self::ENCODED_LEN {
11159 payload_buf[0..avail_len].copy_from_slice(__input);
11160 Bytes::new(&payload_buf)
11161 } else {
11162 Bytes::new(__input)
11163 };
11164 let mut __struct = Self::default();
11165 __struct.seqnr = buf.get_u16_le()?;
11166 for v in &mut __struct.data {
11167 let val = buf.get_u8()?;
11168 *v = val;
11169 }
11170 Ok(__struct)
11171 }
11172 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11173 let mut __tmp = BytesMut::new(bytes);
11174 #[allow(clippy::absurd_extreme_comparisons)]
11175 #[allow(unused_comparisons)]
11176 if __tmp.remaining() < Self::ENCODED_LEN {
11177 panic!(
11178 "buffer is too small (need {} bytes, but got {})",
11179 Self::ENCODED_LEN,
11180 __tmp.remaining(),
11181 )
11182 }
11183 __tmp.put_u16_le(self.seqnr);
11184 for val in &self.data {
11185 __tmp.put_u8(*val);
11186 }
11187 if matches!(version, MavlinkVersion::V2) {
11188 let len = __tmp.len();
11189 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11190 } else {
11191 __tmp.len()
11192 }
11193 }
11194}
11195#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
11196#[doc = ""]
11197#[doc = "ID: 290"]
11198#[derive(Debug, Clone, PartialEq)]
11199#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11200#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11201#[cfg_attr(feature = "ts", derive(TS))]
11202#[cfg_attr(feature = "ts", ts(export))]
11203pub struct ESC_INFO_DATA {
11204 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11205 pub time_usec: u64,
11206 #[doc = "Number of reported errors by each ESC since boot."]
11207 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11208 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11209 pub error_count: [u32; 4],
11210 #[doc = "Counter of data packets received."]
11211 pub counter: u16,
11212 #[doc = "Bitmap of ESC failure flags."]
11213 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11214 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11215 pub failure_flags: [u16; 4],
11216 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
11217 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11218 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11219 pub temperature: [i16; 4],
11220 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11221 pub index: u8,
11222 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
11223 pub count: u8,
11224 #[doc = "Connection type protocol for all ESC."]
11225 pub connection_type: EscConnectionType,
11226 #[doc = "Information regarding online/offline status of each ESC."]
11227 pub info: u8,
11228}
11229impl ESC_INFO_DATA {
11230 pub const ENCODED_LEN: usize = 46usize;
11231 pub const DEFAULT: Self = Self {
11232 time_usec: 0_u64,
11233 error_count: [0_u32; 4usize],
11234 counter: 0_u16,
11235 failure_flags: [0_u16; 4usize],
11236 temperature: [0_i16; 4usize],
11237 index: 0_u8,
11238 count: 0_u8,
11239 connection_type: EscConnectionType::DEFAULT,
11240 info: 0_u8,
11241 };
11242 #[cfg(feature = "arbitrary")]
11243 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11244 use arbitrary::{Arbitrary, Unstructured};
11245 let mut buf = [0u8; 1024];
11246 rng.fill_bytes(&mut buf);
11247 let mut unstructured = Unstructured::new(&buf);
11248 Self::arbitrary(&mut unstructured).unwrap_or_default()
11249 }
11250}
11251impl Default for ESC_INFO_DATA {
11252 fn default() -> Self {
11253 Self::DEFAULT.clone()
11254 }
11255}
11256impl MessageData for ESC_INFO_DATA {
11257 type Message = MavMessage;
11258 const ID: u32 = 290u32;
11259 const NAME: &'static str = "ESC_INFO";
11260 const EXTRA_CRC: u8 = 251u8;
11261 const ENCODED_LEN: usize = 46usize;
11262 fn deser(
11263 _version: MavlinkVersion,
11264 __input: &[u8],
11265 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11266 let avail_len = __input.len();
11267 let mut payload_buf = [0; Self::ENCODED_LEN];
11268 let mut buf = if avail_len < Self::ENCODED_LEN {
11269 payload_buf[0..avail_len].copy_from_slice(__input);
11270 Bytes::new(&payload_buf)
11271 } else {
11272 Bytes::new(__input)
11273 };
11274 let mut __struct = Self::default();
11275 __struct.time_usec = buf.get_u64_le()?;
11276 for v in &mut __struct.error_count {
11277 let val = buf.get_u32_le()?;
11278 *v = val;
11279 }
11280 __struct.counter = buf.get_u16_le()?;
11281 for v in &mut __struct.failure_flags {
11282 let val = buf.get_u16_le()?;
11283 *v = val;
11284 }
11285 for v in &mut __struct.temperature {
11286 let val = buf.get_i16_le()?;
11287 *v = val;
11288 }
11289 __struct.index = buf.get_u8()?;
11290 __struct.count = buf.get_u8()?;
11291 let tmp = buf.get_u8()?;
11292 __struct.connection_type =
11293 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11294 enum_type: "EscConnectionType",
11295 value: tmp as u64,
11296 })?;
11297 __struct.info = buf.get_u8()?;
11298 Ok(__struct)
11299 }
11300 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11301 let mut __tmp = BytesMut::new(bytes);
11302 #[allow(clippy::absurd_extreme_comparisons)]
11303 #[allow(unused_comparisons)]
11304 if __tmp.remaining() < Self::ENCODED_LEN {
11305 panic!(
11306 "buffer is too small (need {} bytes, but got {})",
11307 Self::ENCODED_LEN,
11308 __tmp.remaining(),
11309 )
11310 }
11311 __tmp.put_u64_le(self.time_usec);
11312 for val in &self.error_count {
11313 __tmp.put_u32_le(*val);
11314 }
11315 __tmp.put_u16_le(self.counter);
11316 for val in &self.failure_flags {
11317 __tmp.put_u16_le(*val);
11318 }
11319 for val in &self.temperature {
11320 __tmp.put_i16_le(*val);
11321 }
11322 __tmp.put_u8(self.index);
11323 __tmp.put_u8(self.count);
11324 __tmp.put_u8(self.connection_type as u8);
11325 __tmp.put_u8(self.info);
11326 if matches!(version, MavlinkVersion::V2) {
11327 let len = __tmp.len();
11328 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11329 } else {
11330 __tmp.len()
11331 }
11332 }
11333}
11334#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
11335#[doc = ""]
11336#[doc = "ID: 291"]
11337#[derive(Debug, Clone, PartialEq)]
11338#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11339#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11340#[cfg_attr(feature = "ts", derive(TS))]
11341#[cfg_attr(feature = "ts", ts(export))]
11342pub struct ESC_STATUS_DATA {
11343 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11344 pub time_usec: u64,
11345 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
11346 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11347 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11348 pub rpm: [i32; 4],
11349 #[doc = "Voltage measured from each ESC."]
11350 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11351 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11352 pub voltage: [f32; 4],
11353 #[doc = "Current measured from each ESC."]
11354 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11355 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11356 pub current: [f32; 4],
11357 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11358 pub index: u8,
11359}
11360impl ESC_STATUS_DATA {
11361 pub const ENCODED_LEN: usize = 57usize;
11362 pub const DEFAULT: Self = Self {
11363 time_usec: 0_u64,
11364 rpm: [0_i32; 4usize],
11365 voltage: [0.0_f32; 4usize],
11366 current: [0.0_f32; 4usize],
11367 index: 0_u8,
11368 };
11369 #[cfg(feature = "arbitrary")]
11370 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11371 use arbitrary::{Arbitrary, Unstructured};
11372 let mut buf = [0u8; 1024];
11373 rng.fill_bytes(&mut buf);
11374 let mut unstructured = Unstructured::new(&buf);
11375 Self::arbitrary(&mut unstructured).unwrap_or_default()
11376 }
11377}
11378impl Default for ESC_STATUS_DATA {
11379 fn default() -> Self {
11380 Self::DEFAULT.clone()
11381 }
11382}
11383impl MessageData for ESC_STATUS_DATA {
11384 type Message = MavMessage;
11385 const ID: u32 = 291u32;
11386 const NAME: &'static str = "ESC_STATUS";
11387 const EXTRA_CRC: u8 = 10u8;
11388 const ENCODED_LEN: usize = 57usize;
11389 fn deser(
11390 _version: MavlinkVersion,
11391 __input: &[u8],
11392 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11393 let avail_len = __input.len();
11394 let mut payload_buf = [0; Self::ENCODED_LEN];
11395 let mut buf = if avail_len < Self::ENCODED_LEN {
11396 payload_buf[0..avail_len].copy_from_slice(__input);
11397 Bytes::new(&payload_buf)
11398 } else {
11399 Bytes::new(__input)
11400 };
11401 let mut __struct = Self::default();
11402 __struct.time_usec = buf.get_u64_le()?;
11403 for v in &mut __struct.rpm {
11404 let val = buf.get_i32_le()?;
11405 *v = val;
11406 }
11407 for v in &mut __struct.voltage {
11408 let val = buf.get_f32_le()?;
11409 *v = val;
11410 }
11411 for v in &mut __struct.current {
11412 let val = buf.get_f32_le()?;
11413 *v = val;
11414 }
11415 __struct.index = buf.get_u8()?;
11416 Ok(__struct)
11417 }
11418 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11419 let mut __tmp = BytesMut::new(bytes);
11420 #[allow(clippy::absurd_extreme_comparisons)]
11421 #[allow(unused_comparisons)]
11422 if __tmp.remaining() < Self::ENCODED_LEN {
11423 panic!(
11424 "buffer is too small (need {} bytes, but got {})",
11425 Self::ENCODED_LEN,
11426 __tmp.remaining(),
11427 )
11428 }
11429 __tmp.put_u64_le(self.time_usec);
11430 for val in &self.rpm {
11431 __tmp.put_i32_le(*val);
11432 }
11433 for val in &self.voltage {
11434 __tmp.put_f32_le(*val);
11435 }
11436 for val in &self.current {
11437 __tmp.put_f32_le(*val);
11438 }
11439 __tmp.put_u8(self.index);
11440 if matches!(version, MavlinkVersion::V2) {
11441 let len = __tmp.len();
11442 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11443 } else {
11444 __tmp.len()
11445 }
11446 }
11447}
11448#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
11449#[doc = ""]
11450#[doc = "ID: 230"]
11451#[derive(Debug, Clone, PartialEq)]
11452#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11453#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11454#[cfg_attr(feature = "ts", derive(TS))]
11455#[cfg_attr(feature = "ts", ts(export))]
11456pub struct ESTIMATOR_STATUS_DATA {
11457 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11458 pub time_usec: u64,
11459 #[doc = "Velocity innovation test ratio"]
11460 pub vel_ratio: f32,
11461 #[doc = "Horizontal position innovation test ratio"]
11462 pub pos_horiz_ratio: f32,
11463 #[doc = "Vertical position innovation test ratio"]
11464 pub pos_vert_ratio: f32,
11465 #[doc = "Magnetometer innovation test ratio"]
11466 pub mag_ratio: f32,
11467 #[doc = "Height above terrain innovation test ratio"]
11468 pub hagl_ratio: f32,
11469 #[doc = "True airspeed innovation test ratio"]
11470 pub tas_ratio: f32,
11471 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
11472 pub pos_horiz_accuracy: f32,
11473 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
11474 pub pos_vert_accuracy: f32,
11475 #[doc = "Bitmap indicating which EKF outputs are valid."]
11476 pub flags: EstimatorStatusFlags,
11477}
11478impl ESTIMATOR_STATUS_DATA {
11479 pub const ENCODED_LEN: usize = 42usize;
11480 pub const DEFAULT: Self = Self {
11481 time_usec: 0_u64,
11482 vel_ratio: 0.0_f32,
11483 pos_horiz_ratio: 0.0_f32,
11484 pos_vert_ratio: 0.0_f32,
11485 mag_ratio: 0.0_f32,
11486 hagl_ratio: 0.0_f32,
11487 tas_ratio: 0.0_f32,
11488 pos_horiz_accuracy: 0.0_f32,
11489 pos_vert_accuracy: 0.0_f32,
11490 flags: EstimatorStatusFlags::DEFAULT,
11491 };
11492 #[cfg(feature = "arbitrary")]
11493 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11494 use arbitrary::{Arbitrary, Unstructured};
11495 let mut buf = [0u8; 1024];
11496 rng.fill_bytes(&mut buf);
11497 let mut unstructured = Unstructured::new(&buf);
11498 Self::arbitrary(&mut unstructured).unwrap_or_default()
11499 }
11500}
11501impl Default for ESTIMATOR_STATUS_DATA {
11502 fn default() -> Self {
11503 Self::DEFAULT.clone()
11504 }
11505}
11506impl MessageData for ESTIMATOR_STATUS_DATA {
11507 type Message = MavMessage;
11508 const ID: u32 = 230u32;
11509 const NAME: &'static str = "ESTIMATOR_STATUS";
11510 const EXTRA_CRC: u8 = 163u8;
11511 const ENCODED_LEN: usize = 42usize;
11512 fn deser(
11513 _version: MavlinkVersion,
11514 __input: &[u8],
11515 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11516 let avail_len = __input.len();
11517 let mut payload_buf = [0; Self::ENCODED_LEN];
11518 let mut buf = if avail_len < Self::ENCODED_LEN {
11519 payload_buf[0..avail_len].copy_from_slice(__input);
11520 Bytes::new(&payload_buf)
11521 } else {
11522 Bytes::new(__input)
11523 };
11524 let mut __struct = Self::default();
11525 __struct.time_usec = buf.get_u64_le()?;
11526 __struct.vel_ratio = buf.get_f32_le()?;
11527 __struct.pos_horiz_ratio = buf.get_f32_le()?;
11528 __struct.pos_vert_ratio = buf.get_f32_le()?;
11529 __struct.mag_ratio = buf.get_f32_le()?;
11530 __struct.hagl_ratio = buf.get_f32_le()?;
11531 __struct.tas_ratio = buf.get_f32_le()?;
11532 __struct.pos_horiz_accuracy = buf.get_f32_le()?;
11533 __struct.pos_vert_accuracy = buf.get_f32_le()?;
11534 let tmp = buf.get_u16_le()?;
11535 __struct.flags = EstimatorStatusFlags::from_bits(
11536 tmp as <EstimatorStatusFlags as Flags>::Bits,
11537 )
11538 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11539 flag_type: "EstimatorStatusFlags",
11540 value: tmp as u64,
11541 })?;
11542 Ok(__struct)
11543 }
11544 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11545 let mut __tmp = BytesMut::new(bytes);
11546 #[allow(clippy::absurd_extreme_comparisons)]
11547 #[allow(unused_comparisons)]
11548 if __tmp.remaining() < Self::ENCODED_LEN {
11549 panic!(
11550 "buffer is too small (need {} bytes, but got {})",
11551 Self::ENCODED_LEN,
11552 __tmp.remaining(),
11553 )
11554 }
11555 __tmp.put_u64_le(self.time_usec);
11556 __tmp.put_f32_le(self.vel_ratio);
11557 __tmp.put_f32_le(self.pos_horiz_ratio);
11558 __tmp.put_f32_le(self.pos_vert_ratio);
11559 __tmp.put_f32_le(self.mag_ratio);
11560 __tmp.put_f32_le(self.hagl_ratio);
11561 __tmp.put_f32_le(self.tas_ratio);
11562 __tmp.put_f32_le(self.pos_horiz_accuracy);
11563 __tmp.put_f32_le(self.pos_vert_accuracy);
11564 __tmp.put_u16_le(self.flags.bits() as u16);
11565 if matches!(version, MavlinkVersion::V2) {
11566 let len = __tmp.len();
11567 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11568 } else {
11569 __tmp.len()
11570 }
11571 }
11572}
11573#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
11574#[doc = ""]
11575#[doc = "ID: 410"]
11576#[derive(Debug, Clone, PartialEq)]
11577#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11578#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11579#[cfg_attr(feature = "ts", derive(TS))]
11580#[cfg_attr(feature = "ts", ts(export))]
11581pub struct EVENT_DATA {
11582 #[doc = "Event ID (as defined in the component metadata)"]
11583 pub id: u32,
11584 #[doc = "Timestamp (time since system boot when the event happened)."]
11585 pub event_time_boot_ms: u32,
11586 #[doc = "Sequence number."]
11587 pub sequence: u16,
11588 #[doc = "Component ID"]
11589 pub destination_component: u8,
11590 #[doc = "System ID"]
11591 pub destination_system: u8,
11592 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
11593 pub log_levels: u8,
11594 #[doc = "Arguments (depend on event ID)."]
11595 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11596 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11597 pub arguments: [u8; 40],
11598}
11599impl EVENT_DATA {
11600 pub const ENCODED_LEN: usize = 53usize;
11601 pub const DEFAULT: Self = Self {
11602 id: 0_u32,
11603 event_time_boot_ms: 0_u32,
11604 sequence: 0_u16,
11605 destination_component: 0_u8,
11606 destination_system: 0_u8,
11607 log_levels: 0_u8,
11608 arguments: [0_u8; 40usize],
11609 };
11610 #[cfg(feature = "arbitrary")]
11611 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11612 use arbitrary::{Arbitrary, Unstructured};
11613 let mut buf = [0u8; 1024];
11614 rng.fill_bytes(&mut buf);
11615 let mut unstructured = Unstructured::new(&buf);
11616 Self::arbitrary(&mut unstructured).unwrap_or_default()
11617 }
11618}
11619impl Default for EVENT_DATA {
11620 fn default() -> Self {
11621 Self::DEFAULT.clone()
11622 }
11623}
11624impl MessageData for EVENT_DATA {
11625 type Message = MavMessage;
11626 const ID: u32 = 410u32;
11627 const NAME: &'static str = "EVENT";
11628 const EXTRA_CRC: u8 = 160u8;
11629 const ENCODED_LEN: usize = 53usize;
11630 fn deser(
11631 _version: MavlinkVersion,
11632 __input: &[u8],
11633 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11634 let avail_len = __input.len();
11635 let mut payload_buf = [0; Self::ENCODED_LEN];
11636 let mut buf = if avail_len < Self::ENCODED_LEN {
11637 payload_buf[0..avail_len].copy_from_slice(__input);
11638 Bytes::new(&payload_buf)
11639 } else {
11640 Bytes::new(__input)
11641 };
11642 let mut __struct = Self::default();
11643 __struct.id = buf.get_u32_le()?;
11644 __struct.event_time_boot_ms = buf.get_u32_le()?;
11645 __struct.sequence = buf.get_u16_le()?;
11646 __struct.destination_component = buf.get_u8()?;
11647 __struct.destination_system = buf.get_u8()?;
11648 __struct.log_levels = buf.get_u8()?;
11649 for v in &mut __struct.arguments {
11650 let val = buf.get_u8()?;
11651 *v = val;
11652 }
11653 Ok(__struct)
11654 }
11655 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11656 let mut __tmp = BytesMut::new(bytes);
11657 #[allow(clippy::absurd_extreme_comparisons)]
11658 #[allow(unused_comparisons)]
11659 if __tmp.remaining() < Self::ENCODED_LEN {
11660 panic!(
11661 "buffer is too small (need {} bytes, but got {})",
11662 Self::ENCODED_LEN,
11663 __tmp.remaining(),
11664 )
11665 }
11666 __tmp.put_u32_le(self.id);
11667 __tmp.put_u32_le(self.event_time_boot_ms);
11668 __tmp.put_u16_le(self.sequence);
11669 __tmp.put_u8(self.destination_component);
11670 __tmp.put_u8(self.destination_system);
11671 __tmp.put_u8(self.log_levels);
11672 for val in &self.arguments {
11673 __tmp.put_u8(*val);
11674 }
11675 if matches!(version, MavlinkVersion::V2) {
11676 let len = __tmp.len();
11677 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11678 } else {
11679 __tmp.len()
11680 }
11681 }
11682}
11683#[doc = "Provides state for additional features."]
11684#[doc = ""]
11685#[doc = "ID: 245"]
11686#[derive(Debug, Clone, PartialEq)]
11687#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11688#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11689#[cfg_attr(feature = "ts", derive(TS))]
11690#[cfg_attr(feature = "ts", ts(export))]
11691pub struct EXTENDED_SYS_STATE_DATA {
11692 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
11693 pub vtol_state: MavVtolState,
11694 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
11695 pub landed_state: MavLandedState,
11696}
11697impl EXTENDED_SYS_STATE_DATA {
11698 pub const ENCODED_LEN: usize = 2usize;
11699 pub const DEFAULT: Self = Self {
11700 vtol_state: MavVtolState::DEFAULT,
11701 landed_state: MavLandedState::DEFAULT,
11702 };
11703 #[cfg(feature = "arbitrary")]
11704 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11705 use arbitrary::{Arbitrary, Unstructured};
11706 let mut buf = [0u8; 1024];
11707 rng.fill_bytes(&mut buf);
11708 let mut unstructured = Unstructured::new(&buf);
11709 Self::arbitrary(&mut unstructured).unwrap_or_default()
11710 }
11711}
11712impl Default for EXTENDED_SYS_STATE_DATA {
11713 fn default() -> Self {
11714 Self::DEFAULT.clone()
11715 }
11716}
11717impl MessageData for EXTENDED_SYS_STATE_DATA {
11718 type Message = MavMessage;
11719 const ID: u32 = 245u32;
11720 const NAME: &'static str = "EXTENDED_SYS_STATE";
11721 const EXTRA_CRC: u8 = 130u8;
11722 const ENCODED_LEN: usize = 2usize;
11723 fn deser(
11724 _version: MavlinkVersion,
11725 __input: &[u8],
11726 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11727 let avail_len = __input.len();
11728 let mut payload_buf = [0; Self::ENCODED_LEN];
11729 let mut buf = if avail_len < Self::ENCODED_LEN {
11730 payload_buf[0..avail_len].copy_from_slice(__input);
11731 Bytes::new(&payload_buf)
11732 } else {
11733 Bytes::new(__input)
11734 };
11735 let mut __struct = Self::default();
11736 let tmp = buf.get_u8()?;
11737 __struct.vtol_state =
11738 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11739 enum_type: "MavVtolState",
11740 value: tmp as u64,
11741 })?;
11742 let tmp = buf.get_u8()?;
11743 __struct.landed_state =
11744 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11745 enum_type: "MavLandedState",
11746 value: tmp as u64,
11747 })?;
11748 Ok(__struct)
11749 }
11750 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11751 let mut __tmp = BytesMut::new(bytes);
11752 #[allow(clippy::absurd_extreme_comparisons)]
11753 #[allow(unused_comparisons)]
11754 if __tmp.remaining() < Self::ENCODED_LEN {
11755 panic!(
11756 "buffer is too small (need {} bytes, but got {})",
11757 Self::ENCODED_LEN,
11758 __tmp.remaining(),
11759 )
11760 }
11761 __tmp.put_u8(self.vtol_state as u8);
11762 __tmp.put_u8(self.landed_state as u8);
11763 if matches!(version, MavlinkVersion::V2) {
11764 let len = __tmp.len();
11765 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11766 } else {
11767 __tmp.len()
11768 }
11769 }
11770}
11771#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
11772#[doc = ""]
11773#[doc = "ID: 162"]
11774#[derive(Debug, Clone, PartialEq)]
11775#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11776#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11777#[cfg_attr(feature = "ts", derive(TS))]
11778#[cfg_attr(feature = "ts", ts(export))]
11779pub struct FENCE_STATUS_DATA {
11780 #[doc = "Time (since boot) of last breach."]
11781 pub breach_time: u32,
11782 #[doc = "Number of fence breaches."]
11783 pub breach_count: u16,
11784 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
11785 pub breach_status: u8,
11786 #[doc = "Last breach type."]
11787 pub breach_type: FenceBreach,
11788 #[doc = "Active action to prevent fence breach"]
11789 #[cfg_attr(feature = "serde", serde(default))]
11790 pub breach_mitigation: FenceMitigate,
11791}
11792impl FENCE_STATUS_DATA {
11793 pub const ENCODED_LEN: usize = 9usize;
11794 pub const DEFAULT: Self = Self {
11795 breach_time: 0_u32,
11796 breach_count: 0_u16,
11797 breach_status: 0_u8,
11798 breach_type: FenceBreach::DEFAULT,
11799 breach_mitigation: FenceMitigate::DEFAULT,
11800 };
11801 #[cfg(feature = "arbitrary")]
11802 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11803 use arbitrary::{Arbitrary, Unstructured};
11804 let mut buf = [0u8; 1024];
11805 rng.fill_bytes(&mut buf);
11806 let mut unstructured = Unstructured::new(&buf);
11807 Self::arbitrary(&mut unstructured).unwrap_or_default()
11808 }
11809}
11810impl Default for FENCE_STATUS_DATA {
11811 fn default() -> Self {
11812 Self::DEFAULT.clone()
11813 }
11814}
11815impl MessageData for FENCE_STATUS_DATA {
11816 type Message = MavMessage;
11817 const ID: u32 = 162u32;
11818 const NAME: &'static str = "FENCE_STATUS";
11819 const EXTRA_CRC: u8 = 189u8;
11820 const ENCODED_LEN: usize = 9usize;
11821 fn deser(
11822 _version: MavlinkVersion,
11823 __input: &[u8],
11824 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11825 let avail_len = __input.len();
11826 let mut payload_buf = [0; Self::ENCODED_LEN];
11827 let mut buf = if avail_len < Self::ENCODED_LEN {
11828 payload_buf[0..avail_len].copy_from_slice(__input);
11829 Bytes::new(&payload_buf)
11830 } else {
11831 Bytes::new(__input)
11832 };
11833 let mut __struct = Self::default();
11834 __struct.breach_time = buf.get_u32_le()?;
11835 __struct.breach_count = buf.get_u16_le()?;
11836 __struct.breach_status = buf.get_u8()?;
11837 let tmp = buf.get_u8()?;
11838 __struct.breach_type =
11839 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11840 enum_type: "FenceBreach",
11841 value: tmp as u64,
11842 })?;
11843 let tmp = buf.get_u8()?;
11844 __struct.breach_mitigation =
11845 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11846 enum_type: "FenceMitigate",
11847 value: tmp as u64,
11848 })?;
11849 Ok(__struct)
11850 }
11851 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11852 let mut __tmp = BytesMut::new(bytes);
11853 #[allow(clippy::absurd_extreme_comparisons)]
11854 #[allow(unused_comparisons)]
11855 if __tmp.remaining() < Self::ENCODED_LEN {
11856 panic!(
11857 "buffer is too small (need {} bytes, but got {})",
11858 Self::ENCODED_LEN,
11859 __tmp.remaining(),
11860 )
11861 }
11862 __tmp.put_u32_le(self.breach_time);
11863 __tmp.put_u16_le(self.breach_count);
11864 __tmp.put_u8(self.breach_status);
11865 __tmp.put_u8(self.breach_type as u8);
11866 if matches!(version, MavlinkVersion::V2) {
11867 __tmp.put_u8(self.breach_mitigation as u8);
11868 let len = __tmp.len();
11869 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11870 } else {
11871 __tmp.len()
11872 }
11873 }
11874}
11875#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
11876#[doc = ""]
11877#[doc = "ID: 110"]
11878#[derive(Debug, Clone, PartialEq)]
11879#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11880#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11881#[cfg_attr(feature = "ts", derive(TS))]
11882#[cfg_attr(feature = "ts", ts(export))]
11883pub struct FILE_TRANSFER_PROTOCOL_DATA {
11884 #[doc = "Network ID (0 for broadcast)"]
11885 pub target_network: u8,
11886 #[doc = "System ID (0 for broadcast)"]
11887 pub target_system: u8,
11888 #[doc = "Component ID (0 for broadcast)"]
11889 pub target_component: u8,
11890 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
11891 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11892 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11893 pub payload: [u8; 251],
11894}
11895impl FILE_TRANSFER_PROTOCOL_DATA {
11896 pub const ENCODED_LEN: usize = 254usize;
11897 pub const DEFAULT: Self = Self {
11898 target_network: 0_u8,
11899 target_system: 0_u8,
11900 target_component: 0_u8,
11901 payload: [0_u8; 251usize],
11902 };
11903 #[cfg(feature = "arbitrary")]
11904 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11905 use arbitrary::{Arbitrary, Unstructured};
11906 let mut buf = [0u8; 1024];
11907 rng.fill_bytes(&mut buf);
11908 let mut unstructured = Unstructured::new(&buf);
11909 Self::arbitrary(&mut unstructured).unwrap_or_default()
11910 }
11911}
11912impl Default for FILE_TRANSFER_PROTOCOL_DATA {
11913 fn default() -> Self {
11914 Self::DEFAULT.clone()
11915 }
11916}
11917impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
11918 type Message = MavMessage;
11919 const ID: u32 = 110u32;
11920 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
11921 const EXTRA_CRC: u8 = 84u8;
11922 const ENCODED_LEN: usize = 254usize;
11923 fn deser(
11924 _version: MavlinkVersion,
11925 __input: &[u8],
11926 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11927 let avail_len = __input.len();
11928 let mut payload_buf = [0; Self::ENCODED_LEN];
11929 let mut buf = if avail_len < Self::ENCODED_LEN {
11930 payload_buf[0..avail_len].copy_from_slice(__input);
11931 Bytes::new(&payload_buf)
11932 } else {
11933 Bytes::new(__input)
11934 };
11935 let mut __struct = Self::default();
11936 __struct.target_network = buf.get_u8()?;
11937 __struct.target_system = buf.get_u8()?;
11938 __struct.target_component = buf.get_u8()?;
11939 for v in &mut __struct.payload {
11940 let val = buf.get_u8()?;
11941 *v = val;
11942 }
11943 Ok(__struct)
11944 }
11945 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11946 let mut __tmp = BytesMut::new(bytes);
11947 #[allow(clippy::absurd_extreme_comparisons)]
11948 #[allow(unused_comparisons)]
11949 if __tmp.remaining() < Self::ENCODED_LEN {
11950 panic!(
11951 "buffer is too small (need {} bytes, but got {})",
11952 Self::ENCODED_LEN,
11953 __tmp.remaining(),
11954 )
11955 }
11956 __tmp.put_u8(self.target_network);
11957 __tmp.put_u8(self.target_system);
11958 __tmp.put_u8(self.target_component);
11959 for val in &self.payload {
11960 __tmp.put_u8(*val);
11961 }
11962 if matches!(version, MavlinkVersion::V2) {
11963 let len = __tmp.len();
11964 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11965 } else {
11966 __tmp.len()
11967 }
11968 }
11969}
11970#[doc = "Flexifunction type and parameters for component at function index from buffer."]
11971#[doc = ""]
11972#[doc = "ID: 152"]
11973#[derive(Debug, Clone, PartialEq)]
11974#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11975#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11976#[cfg_attr(feature = "ts", derive(TS))]
11977#[cfg_attr(feature = "ts", ts(export))]
11978pub struct FLEXIFUNCTION_BUFFER_FUNCTION_DATA {
11979 #[doc = "Function index"]
11980 pub func_index: u16,
11981 #[doc = "Total count of functions"]
11982 pub func_count: u16,
11983 #[doc = "Address in the flexifunction data, Set to 0xFFFF to use address in target memory"]
11984 pub data_address: u16,
11985 #[doc = "Size of the"]
11986 pub data_size: u16,
11987 #[doc = "System ID"]
11988 pub target_system: u8,
11989 #[doc = "Component ID"]
11990 pub target_component: u8,
11991 #[doc = "Settings data"]
11992 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11993 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11994 pub data: [i8; 48],
11995}
11996impl FLEXIFUNCTION_BUFFER_FUNCTION_DATA {
11997 pub const ENCODED_LEN: usize = 58usize;
11998 pub const DEFAULT: Self = Self {
11999 func_index: 0_u16,
12000 func_count: 0_u16,
12001 data_address: 0_u16,
12002 data_size: 0_u16,
12003 target_system: 0_u8,
12004 target_component: 0_u8,
12005 data: [0_i8; 48usize],
12006 };
12007 #[cfg(feature = "arbitrary")]
12008 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12009 use arbitrary::{Arbitrary, Unstructured};
12010 let mut buf = [0u8; 1024];
12011 rng.fill_bytes(&mut buf);
12012 let mut unstructured = Unstructured::new(&buf);
12013 Self::arbitrary(&mut unstructured).unwrap_or_default()
12014 }
12015}
12016impl Default for FLEXIFUNCTION_BUFFER_FUNCTION_DATA {
12017 fn default() -> Self {
12018 Self::DEFAULT.clone()
12019 }
12020}
12021impl MessageData for FLEXIFUNCTION_BUFFER_FUNCTION_DATA {
12022 type Message = MavMessage;
12023 const ID: u32 = 152u32;
12024 const NAME: &'static str = "FLEXIFUNCTION_BUFFER_FUNCTION";
12025 const EXTRA_CRC: u8 = 101u8;
12026 const ENCODED_LEN: usize = 58usize;
12027 fn deser(
12028 _version: MavlinkVersion,
12029 __input: &[u8],
12030 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12031 let avail_len = __input.len();
12032 let mut payload_buf = [0; Self::ENCODED_LEN];
12033 let mut buf = if avail_len < Self::ENCODED_LEN {
12034 payload_buf[0..avail_len].copy_from_slice(__input);
12035 Bytes::new(&payload_buf)
12036 } else {
12037 Bytes::new(__input)
12038 };
12039 let mut __struct = Self::default();
12040 __struct.func_index = buf.get_u16_le()?;
12041 __struct.func_count = buf.get_u16_le()?;
12042 __struct.data_address = buf.get_u16_le()?;
12043 __struct.data_size = buf.get_u16_le()?;
12044 __struct.target_system = buf.get_u8()?;
12045 __struct.target_component = buf.get_u8()?;
12046 for v in &mut __struct.data {
12047 let val = buf.get_i8()?;
12048 *v = val;
12049 }
12050 Ok(__struct)
12051 }
12052 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12053 let mut __tmp = BytesMut::new(bytes);
12054 #[allow(clippy::absurd_extreme_comparisons)]
12055 #[allow(unused_comparisons)]
12056 if __tmp.remaining() < Self::ENCODED_LEN {
12057 panic!(
12058 "buffer is too small (need {} bytes, but got {})",
12059 Self::ENCODED_LEN,
12060 __tmp.remaining(),
12061 )
12062 }
12063 __tmp.put_u16_le(self.func_index);
12064 __tmp.put_u16_le(self.func_count);
12065 __tmp.put_u16_le(self.data_address);
12066 __tmp.put_u16_le(self.data_size);
12067 __tmp.put_u8(self.target_system);
12068 __tmp.put_u8(self.target_component);
12069 for val in &self.data {
12070 __tmp.put_i8(*val);
12071 }
12072 if matches!(version, MavlinkVersion::V2) {
12073 let len = __tmp.len();
12074 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12075 } else {
12076 __tmp.len()
12077 }
12078 }
12079}
12080#[doc = "Flexifunction type and parameters for component at function index from buffer."]
12081#[doc = ""]
12082#[doc = "ID: 153"]
12083#[derive(Debug, Clone, PartialEq)]
12084#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12085#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12086#[cfg_attr(feature = "ts", derive(TS))]
12087#[cfg_attr(feature = "ts", ts(export))]
12088pub struct FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA {
12089 #[doc = "Function index"]
12090 pub func_index: u16,
12091 #[doc = "result of acknowledge, 0=fail, 1=good"]
12092 pub result: u16,
12093 #[doc = "System ID"]
12094 pub target_system: u8,
12095 #[doc = "Component ID"]
12096 pub target_component: u8,
12097}
12098impl FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA {
12099 pub const ENCODED_LEN: usize = 6usize;
12100 pub const DEFAULT: Self = Self {
12101 func_index: 0_u16,
12102 result: 0_u16,
12103 target_system: 0_u8,
12104 target_component: 0_u8,
12105 };
12106 #[cfg(feature = "arbitrary")]
12107 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12108 use arbitrary::{Arbitrary, Unstructured};
12109 let mut buf = [0u8; 1024];
12110 rng.fill_bytes(&mut buf);
12111 let mut unstructured = Unstructured::new(&buf);
12112 Self::arbitrary(&mut unstructured).unwrap_or_default()
12113 }
12114}
12115impl Default for FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA {
12116 fn default() -> Self {
12117 Self::DEFAULT.clone()
12118 }
12119}
12120impl MessageData for FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA {
12121 type Message = MavMessage;
12122 const ID: u32 = 153u32;
12123 const NAME: &'static str = "FLEXIFUNCTION_BUFFER_FUNCTION_ACK";
12124 const EXTRA_CRC: u8 = 109u8;
12125 const ENCODED_LEN: usize = 6usize;
12126 fn deser(
12127 _version: MavlinkVersion,
12128 __input: &[u8],
12129 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12130 let avail_len = __input.len();
12131 let mut payload_buf = [0; Self::ENCODED_LEN];
12132 let mut buf = if avail_len < Self::ENCODED_LEN {
12133 payload_buf[0..avail_len].copy_from_slice(__input);
12134 Bytes::new(&payload_buf)
12135 } else {
12136 Bytes::new(__input)
12137 };
12138 let mut __struct = Self::default();
12139 __struct.func_index = buf.get_u16_le()?;
12140 __struct.result = buf.get_u16_le()?;
12141 __struct.target_system = buf.get_u8()?;
12142 __struct.target_component = buf.get_u8()?;
12143 Ok(__struct)
12144 }
12145 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12146 let mut __tmp = BytesMut::new(bytes);
12147 #[allow(clippy::absurd_extreme_comparisons)]
12148 #[allow(unused_comparisons)]
12149 if __tmp.remaining() < Self::ENCODED_LEN {
12150 panic!(
12151 "buffer is too small (need {} bytes, but got {})",
12152 Self::ENCODED_LEN,
12153 __tmp.remaining(),
12154 )
12155 }
12156 __tmp.put_u16_le(self.func_index);
12157 __tmp.put_u16_le(self.result);
12158 __tmp.put_u8(self.target_system);
12159 __tmp.put_u8(self.target_component);
12160 if matches!(version, MavlinkVersion::V2) {
12161 let len = __tmp.len();
12162 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12163 } else {
12164 __tmp.len()
12165 }
12166 }
12167}
12168#[doc = "Acknowldge success or failure of a flexifunction command."]
12169#[doc = ""]
12170#[doc = "ID: 157"]
12171#[derive(Debug, Clone, PartialEq)]
12172#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12173#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12174#[cfg_attr(feature = "ts", derive(TS))]
12175#[cfg_attr(feature = "ts", ts(export))]
12176pub struct FLEXIFUNCTION_COMMAND_DATA {
12177 #[doc = "System ID"]
12178 pub target_system: u8,
12179 #[doc = "Component ID"]
12180 pub target_component: u8,
12181 #[doc = "Flexifunction command type"]
12182 pub command_type: u8,
12183}
12184impl FLEXIFUNCTION_COMMAND_DATA {
12185 pub const ENCODED_LEN: usize = 3usize;
12186 pub const DEFAULT: Self = Self {
12187 target_system: 0_u8,
12188 target_component: 0_u8,
12189 command_type: 0_u8,
12190 };
12191 #[cfg(feature = "arbitrary")]
12192 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12193 use arbitrary::{Arbitrary, Unstructured};
12194 let mut buf = [0u8; 1024];
12195 rng.fill_bytes(&mut buf);
12196 let mut unstructured = Unstructured::new(&buf);
12197 Self::arbitrary(&mut unstructured).unwrap_or_default()
12198 }
12199}
12200impl Default for FLEXIFUNCTION_COMMAND_DATA {
12201 fn default() -> Self {
12202 Self::DEFAULT.clone()
12203 }
12204}
12205impl MessageData for FLEXIFUNCTION_COMMAND_DATA {
12206 type Message = MavMessage;
12207 const ID: u32 = 157u32;
12208 const NAME: &'static str = "FLEXIFUNCTION_COMMAND";
12209 const EXTRA_CRC: u8 = 133u8;
12210 const ENCODED_LEN: usize = 3usize;
12211 fn deser(
12212 _version: MavlinkVersion,
12213 __input: &[u8],
12214 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12215 let avail_len = __input.len();
12216 let mut payload_buf = [0; Self::ENCODED_LEN];
12217 let mut buf = if avail_len < Self::ENCODED_LEN {
12218 payload_buf[0..avail_len].copy_from_slice(__input);
12219 Bytes::new(&payload_buf)
12220 } else {
12221 Bytes::new(__input)
12222 };
12223 let mut __struct = Self::default();
12224 __struct.target_system = buf.get_u8()?;
12225 __struct.target_component = buf.get_u8()?;
12226 __struct.command_type = buf.get_u8()?;
12227 Ok(__struct)
12228 }
12229 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12230 let mut __tmp = BytesMut::new(bytes);
12231 #[allow(clippy::absurd_extreme_comparisons)]
12232 #[allow(unused_comparisons)]
12233 if __tmp.remaining() < Self::ENCODED_LEN {
12234 panic!(
12235 "buffer is too small (need {} bytes, but got {})",
12236 Self::ENCODED_LEN,
12237 __tmp.remaining(),
12238 )
12239 }
12240 __tmp.put_u8(self.target_system);
12241 __tmp.put_u8(self.target_component);
12242 __tmp.put_u8(self.command_type);
12243 if matches!(version, MavlinkVersion::V2) {
12244 let len = __tmp.len();
12245 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12246 } else {
12247 __tmp.len()
12248 }
12249 }
12250}
12251#[doc = "Acknowldge success or failure of a flexifunction command."]
12252#[doc = ""]
12253#[doc = "ID: 158"]
12254#[derive(Debug, Clone, PartialEq)]
12255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12256#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12257#[cfg_attr(feature = "ts", derive(TS))]
12258#[cfg_attr(feature = "ts", ts(export))]
12259pub struct FLEXIFUNCTION_COMMAND_ACK_DATA {
12260 #[doc = "Command acknowledged"]
12261 pub command_type: u16,
12262 #[doc = "result of acknowledge"]
12263 pub result: u16,
12264}
12265impl FLEXIFUNCTION_COMMAND_ACK_DATA {
12266 pub const ENCODED_LEN: usize = 4usize;
12267 pub const DEFAULT: Self = Self {
12268 command_type: 0_u16,
12269 result: 0_u16,
12270 };
12271 #[cfg(feature = "arbitrary")]
12272 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12273 use arbitrary::{Arbitrary, Unstructured};
12274 let mut buf = [0u8; 1024];
12275 rng.fill_bytes(&mut buf);
12276 let mut unstructured = Unstructured::new(&buf);
12277 Self::arbitrary(&mut unstructured).unwrap_or_default()
12278 }
12279}
12280impl Default for FLEXIFUNCTION_COMMAND_ACK_DATA {
12281 fn default() -> Self {
12282 Self::DEFAULT.clone()
12283 }
12284}
12285impl MessageData for FLEXIFUNCTION_COMMAND_ACK_DATA {
12286 type Message = MavMessage;
12287 const ID: u32 = 158u32;
12288 const NAME: &'static str = "FLEXIFUNCTION_COMMAND_ACK";
12289 const EXTRA_CRC: u8 = 208u8;
12290 const ENCODED_LEN: usize = 4usize;
12291 fn deser(
12292 _version: MavlinkVersion,
12293 __input: &[u8],
12294 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12295 let avail_len = __input.len();
12296 let mut payload_buf = [0; Self::ENCODED_LEN];
12297 let mut buf = if avail_len < Self::ENCODED_LEN {
12298 payload_buf[0..avail_len].copy_from_slice(__input);
12299 Bytes::new(&payload_buf)
12300 } else {
12301 Bytes::new(__input)
12302 };
12303 let mut __struct = Self::default();
12304 __struct.command_type = buf.get_u16_le()?;
12305 __struct.result = buf.get_u16_le()?;
12306 Ok(__struct)
12307 }
12308 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12309 let mut __tmp = BytesMut::new(bytes);
12310 #[allow(clippy::absurd_extreme_comparisons)]
12311 #[allow(unused_comparisons)]
12312 if __tmp.remaining() < Self::ENCODED_LEN {
12313 panic!(
12314 "buffer is too small (need {} bytes, but got {})",
12315 Self::ENCODED_LEN,
12316 __tmp.remaining(),
12317 )
12318 }
12319 __tmp.put_u16_le(self.command_type);
12320 __tmp.put_u16_le(self.result);
12321 if matches!(version, MavlinkVersion::V2) {
12322 let len = __tmp.len();
12323 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12324 } else {
12325 __tmp.len()
12326 }
12327 }
12328}
12329#[doc = "Acknowldge success or failure of a flexifunction command."]
12330#[doc = ""]
12331#[doc = "ID: 155"]
12332#[derive(Debug, Clone, PartialEq)]
12333#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12334#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12335#[cfg_attr(feature = "ts", derive(TS))]
12336#[cfg_attr(feature = "ts", ts(export))]
12337pub struct FLEXIFUNCTION_DIRECTORY_DATA {
12338 #[doc = "System ID"]
12339 pub target_system: u8,
12340 #[doc = "Component ID"]
12341 pub target_component: u8,
12342 #[doc = "0=inputs, 1=outputs"]
12343 pub directory_type: u8,
12344 #[doc = "index of first directory entry to write"]
12345 pub start_index: u8,
12346 #[doc = "count of directory entries to write"]
12347 pub count: u8,
12348 #[doc = "Settings data"]
12349 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12350 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12351 pub directory_data: [i8; 48],
12352}
12353impl FLEXIFUNCTION_DIRECTORY_DATA {
12354 pub const ENCODED_LEN: usize = 53usize;
12355 pub const DEFAULT: Self = Self {
12356 target_system: 0_u8,
12357 target_component: 0_u8,
12358 directory_type: 0_u8,
12359 start_index: 0_u8,
12360 count: 0_u8,
12361 directory_data: [0_i8; 48usize],
12362 };
12363 #[cfg(feature = "arbitrary")]
12364 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12365 use arbitrary::{Arbitrary, Unstructured};
12366 let mut buf = [0u8; 1024];
12367 rng.fill_bytes(&mut buf);
12368 let mut unstructured = Unstructured::new(&buf);
12369 Self::arbitrary(&mut unstructured).unwrap_or_default()
12370 }
12371}
12372impl Default for FLEXIFUNCTION_DIRECTORY_DATA {
12373 fn default() -> Self {
12374 Self::DEFAULT.clone()
12375 }
12376}
12377impl MessageData for FLEXIFUNCTION_DIRECTORY_DATA {
12378 type Message = MavMessage;
12379 const ID: u32 = 155u32;
12380 const NAME: &'static str = "FLEXIFUNCTION_DIRECTORY";
12381 const EXTRA_CRC: u8 = 12u8;
12382 const ENCODED_LEN: usize = 53usize;
12383 fn deser(
12384 _version: MavlinkVersion,
12385 __input: &[u8],
12386 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12387 let avail_len = __input.len();
12388 let mut payload_buf = [0; Self::ENCODED_LEN];
12389 let mut buf = if avail_len < Self::ENCODED_LEN {
12390 payload_buf[0..avail_len].copy_from_slice(__input);
12391 Bytes::new(&payload_buf)
12392 } else {
12393 Bytes::new(__input)
12394 };
12395 let mut __struct = Self::default();
12396 __struct.target_system = buf.get_u8()?;
12397 __struct.target_component = buf.get_u8()?;
12398 __struct.directory_type = buf.get_u8()?;
12399 __struct.start_index = buf.get_u8()?;
12400 __struct.count = buf.get_u8()?;
12401 for v in &mut __struct.directory_data {
12402 let val = buf.get_i8()?;
12403 *v = val;
12404 }
12405 Ok(__struct)
12406 }
12407 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12408 let mut __tmp = BytesMut::new(bytes);
12409 #[allow(clippy::absurd_extreme_comparisons)]
12410 #[allow(unused_comparisons)]
12411 if __tmp.remaining() < Self::ENCODED_LEN {
12412 panic!(
12413 "buffer is too small (need {} bytes, but got {})",
12414 Self::ENCODED_LEN,
12415 __tmp.remaining(),
12416 )
12417 }
12418 __tmp.put_u8(self.target_system);
12419 __tmp.put_u8(self.target_component);
12420 __tmp.put_u8(self.directory_type);
12421 __tmp.put_u8(self.start_index);
12422 __tmp.put_u8(self.count);
12423 for val in &self.directory_data {
12424 __tmp.put_i8(*val);
12425 }
12426 if matches!(version, MavlinkVersion::V2) {
12427 let len = __tmp.len();
12428 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12429 } else {
12430 __tmp.len()
12431 }
12432 }
12433}
12434#[doc = "Acknowldge success or failure of a flexifunction command."]
12435#[doc = ""]
12436#[doc = "ID: 156"]
12437#[derive(Debug, Clone, PartialEq)]
12438#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12439#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12440#[cfg_attr(feature = "ts", derive(TS))]
12441#[cfg_attr(feature = "ts", ts(export))]
12442pub struct FLEXIFUNCTION_DIRECTORY_ACK_DATA {
12443 #[doc = "result of acknowledge, 0=fail, 1=good"]
12444 pub result: u16,
12445 #[doc = "System ID"]
12446 pub target_system: u8,
12447 #[doc = "Component ID"]
12448 pub target_component: u8,
12449 #[doc = "0=inputs, 1=outputs"]
12450 pub directory_type: u8,
12451 #[doc = "index of first directory entry to write"]
12452 pub start_index: u8,
12453 #[doc = "count of directory entries to write"]
12454 pub count: u8,
12455}
12456impl FLEXIFUNCTION_DIRECTORY_ACK_DATA {
12457 pub const ENCODED_LEN: usize = 7usize;
12458 pub const DEFAULT: Self = Self {
12459 result: 0_u16,
12460 target_system: 0_u8,
12461 target_component: 0_u8,
12462 directory_type: 0_u8,
12463 start_index: 0_u8,
12464 count: 0_u8,
12465 };
12466 #[cfg(feature = "arbitrary")]
12467 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12468 use arbitrary::{Arbitrary, Unstructured};
12469 let mut buf = [0u8; 1024];
12470 rng.fill_bytes(&mut buf);
12471 let mut unstructured = Unstructured::new(&buf);
12472 Self::arbitrary(&mut unstructured).unwrap_or_default()
12473 }
12474}
12475impl Default for FLEXIFUNCTION_DIRECTORY_ACK_DATA {
12476 fn default() -> Self {
12477 Self::DEFAULT.clone()
12478 }
12479}
12480impl MessageData for FLEXIFUNCTION_DIRECTORY_ACK_DATA {
12481 type Message = MavMessage;
12482 const ID: u32 = 156u32;
12483 const NAME: &'static str = "FLEXIFUNCTION_DIRECTORY_ACK";
12484 const EXTRA_CRC: u8 = 218u8;
12485 const ENCODED_LEN: usize = 7usize;
12486 fn deser(
12487 _version: MavlinkVersion,
12488 __input: &[u8],
12489 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12490 let avail_len = __input.len();
12491 let mut payload_buf = [0; Self::ENCODED_LEN];
12492 let mut buf = if avail_len < Self::ENCODED_LEN {
12493 payload_buf[0..avail_len].copy_from_slice(__input);
12494 Bytes::new(&payload_buf)
12495 } else {
12496 Bytes::new(__input)
12497 };
12498 let mut __struct = Self::default();
12499 __struct.result = buf.get_u16_le()?;
12500 __struct.target_system = buf.get_u8()?;
12501 __struct.target_component = buf.get_u8()?;
12502 __struct.directory_type = buf.get_u8()?;
12503 __struct.start_index = buf.get_u8()?;
12504 __struct.count = buf.get_u8()?;
12505 Ok(__struct)
12506 }
12507 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12508 let mut __tmp = BytesMut::new(bytes);
12509 #[allow(clippy::absurd_extreme_comparisons)]
12510 #[allow(unused_comparisons)]
12511 if __tmp.remaining() < Self::ENCODED_LEN {
12512 panic!(
12513 "buffer is too small (need {} bytes, but got {})",
12514 Self::ENCODED_LEN,
12515 __tmp.remaining(),
12516 )
12517 }
12518 __tmp.put_u16_le(self.result);
12519 __tmp.put_u8(self.target_system);
12520 __tmp.put_u8(self.target_component);
12521 __tmp.put_u8(self.directory_type);
12522 __tmp.put_u8(self.start_index);
12523 __tmp.put_u8(self.count);
12524 if matches!(version, MavlinkVersion::V2) {
12525 let len = __tmp.len();
12526 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12527 } else {
12528 __tmp.len()
12529 }
12530 }
12531}
12532#[doc = "Request reading of flexifunction data."]
12533#[doc = ""]
12534#[doc = "ID: 151"]
12535#[derive(Debug, Clone, PartialEq)]
12536#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12537#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12538#[cfg_attr(feature = "ts", derive(TS))]
12539#[cfg_attr(feature = "ts", ts(export))]
12540pub struct FLEXIFUNCTION_READ_REQ_DATA {
12541 #[doc = "Type of flexifunction data requested"]
12542 pub read_req_type: i16,
12543 #[doc = "index into data where needed"]
12544 pub data_index: i16,
12545 #[doc = "System ID"]
12546 pub target_system: u8,
12547 #[doc = "Component ID"]
12548 pub target_component: u8,
12549}
12550impl FLEXIFUNCTION_READ_REQ_DATA {
12551 pub const ENCODED_LEN: usize = 6usize;
12552 pub const DEFAULT: Self = Self {
12553 read_req_type: 0_i16,
12554 data_index: 0_i16,
12555 target_system: 0_u8,
12556 target_component: 0_u8,
12557 };
12558 #[cfg(feature = "arbitrary")]
12559 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12560 use arbitrary::{Arbitrary, Unstructured};
12561 let mut buf = [0u8; 1024];
12562 rng.fill_bytes(&mut buf);
12563 let mut unstructured = Unstructured::new(&buf);
12564 Self::arbitrary(&mut unstructured).unwrap_or_default()
12565 }
12566}
12567impl Default for FLEXIFUNCTION_READ_REQ_DATA {
12568 fn default() -> Self {
12569 Self::DEFAULT.clone()
12570 }
12571}
12572impl MessageData for FLEXIFUNCTION_READ_REQ_DATA {
12573 type Message = MavMessage;
12574 const ID: u32 = 151u32;
12575 const NAME: &'static str = "FLEXIFUNCTION_READ_REQ";
12576 const EXTRA_CRC: u8 = 26u8;
12577 const ENCODED_LEN: usize = 6usize;
12578 fn deser(
12579 _version: MavlinkVersion,
12580 __input: &[u8],
12581 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12582 let avail_len = __input.len();
12583 let mut payload_buf = [0; Self::ENCODED_LEN];
12584 let mut buf = if avail_len < Self::ENCODED_LEN {
12585 payload_buf[0..avail_len].copy_from_slice(__input);
12586 Bytes::new(&payload_buf)
12587 } else {
12588 Bytes::new(__input)
12589 };
12590 let mut __struct = Self::default();
12591 __struct.read_req_type = buf.get_i16_le()?;
12592 __struct.data_index = buf.get_i16_le()?;
12593 __struct.target_system = buf.get_u8()?;
12594 __struct.target_component = buf.get_u8()?;
12595 Ok(__struct)
12596 }
12597 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12598 let mut __tmp = BytesMut::new(bytes);
12599 #[allow(clippy::absurd_extreme_comparisons)]
12600 #[allow(unused_comparisons)]
12601 if __tmp.remaining() < Self::ENCODED_LEN {
12602 panic!(
12603 "buffer is too small (need {} bytes, but got {})",
12604 Self::ENCODED_LEN,
12605 __tmp.remaining(),
12606 )
12607 }
12608 __tmp.put_i16_le(self.read_req_type);
12609 __tmp.put_i16_le(self.data_index);
12610 __tmp.put_u8(self.target_system);
12611 __tmp.put_u8(self.target_component);
12612 if matches!(version, MavlinkVersion::V2) {
12613 let len = __tmp.len();
12614 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12615 } else {
12616 __tmp.len()
12617 }
12618 }
12619}
12620#[doc = "Depreciated but used as a compiler flag. Do not remove."]
12621#[doc = ""]
12622#[doc = "ID: 150"]
12623#[derive(Debug, Clone, PartialEq)]
12624#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12625#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12626#[cfg_attr(feature = "ts", derive(TS))]
12627#[cfg_attr(feature = "ts", ts(export))]
12628pub struct FLEXIFUNCTION_SET_DATA {
12629 #[doc = "System ID"]
12630 pub target_system: u8,
12631 #[doc = "Component ID"]
12632 pub target_component: u8,
12633}
12634impl FLEXIFUNCTION_SET_DATA {
12635 pub const ENCODED_LEN: usize = 2usize;
12636 pub const DEFAULT: Self = Self {
12637 target_system: 0_u8,
12638 target_component: 0_u8,
12639 };
12640 #[cfg(feature = "arbitrary")]
12641 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12642 use arbitrary::{Arbitrary, Unstructured};
12643 let mut buf = [0u8; 1024];
12644 rng.fill_bytes(&mut buf);
12645 let mut unstructured = Unstructured::new(&buf);
12646 Self::arbitrary(&mut unstructured).unwrap_or_default()
12647 }
12648}
12649impl Default for FLEXIFUNCTION_SET_DATA {
12650 fn default() -> Self {
12651 Self::DEFAULT.clone()
12652 }
12653}
12654impl MessageData for FLEXIFUNCTION_SET_DATA {
12655 type Message = MavMessage;
12656 const ID: u32 = 150u32;
12657 const NAME: &'static str = "FLEXIFUNCTION_SET";
12658 const EXTRA_CRC: u8 = 181u8;
12659 const ENCODED_LEN: usize = 2usize;
12660 fn deser(
12661 _version: MavlinkVersion,
12662 __input: &[u8],
12663 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12664 let avail_len = __input.len();
12665 let mut payload_buf = [0; Self::ENCODED_LEN];
12666 let mut buf = if avail_len < Self::ENCODED_LEN {
12667 payload_buf[0..avail_len].copy_from_slice(__input);
12668 Bytes::new(&payload_buf)
12669 } else {
12670 Bytes::new(__input)
12671 };
12672 let mut __struct = Self::default();
12673 __struct.target_system = buf.get_u8()?;
12674 __struct.target_component = buf.get_u8()?;
12675 Ok(__struct)
12676 }
12677 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12678 let mut __tmp = BytesMut::new(bytes);
12679 #[allow(clippy::absurd_extreme_comparisons)]
12680 #[allow(unused_comparisons)]
12681 if __tmp.remaining() < Self::ENCODED_LEN {
12682 panic!(
12683 "buffer is too small (need {} bytes, but got {})",
12684 Self::ENCODED_LEN,
12685 __tmp.remaining(),
12686 )
12687 }
12688 __tmp.put_u8(self.target_system);
12689 __tmp.put_u8(self.target_component);
12690 if matches!(version, MavlinkVersion::V2) {
12691 let len = __tmp.len();
12692 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12693 } else {
12694 __tmp.len()
12695 }
12696 }
12697}
12698#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
12699#[doc = ""]
12700#[doc = "ID: 264"]
12701#[derive(Debug, Clone, PartialEq)]
12702#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12703#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12704#[cfg_attr(feature = "ts", derive(TS))]
12705#[cfg_attr(feature = "ts", ts(export))]
12706pub struct FLIGHT_INFORMATION_DATA {
12707 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
12708 pub arming_time_utc: u64,
12709 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
12710 pub takeoff_time_utc: u64,
12711 #[doc = "Flight number. Note, field is misnamed UUID."]
12712 pub flight_uuid: u64,
12713 #[doc = "Timestamp (time since system boot)."]
12714 pub time_boot_ms: u32,
12715 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
12716 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12717 pub landing_time: u32,
12718}
12719impl FLIGHT_INFORMATION_DATA {
12720 pub const ENCODED_LEN: usize = 32usize;
12721 pub const DEFAULT: Self = Self {
12722 arming_time_utc: 0_u64,
12723 takeoff_time_utc: 0_u64,
12724 flight_uuid: 0_u64,
12725 time_boot_ms: 0_u32,
12726 landing_time: 0_u32,
12727 };
12728 #[cfg(feature = "arbitrary")]
12729 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12730 use arbitrary::{Arbitrary, Unstructured};
12731 let mut buf = [0u8; 1024];
12732 rng.fill_bytes(&mut buf);
12733 let mut unstructured = Unstructured::new(&buf);
12734 Self::arbitrary(&mut unstructured).unwrap_or_default()
12735 }
12736}
12737impl Default for FLIGHT_INFORMATION_DATA {
12738 fn default() -> Self {
12739 Self::DEFAULT.clone()
12740 }
12741}
12742impl MessageData for FLIGHT_INFORMATION_DATA {
12743 type Message = MavMessage;
12744 const ID: u32 = 264u32;
12745 const NAME: &'static str = "FLIGHT_INFORMATION";
12746 const EXTRA_CRC: u8 = 49u8;
12747 const ENCODED_LEN: usize = 32usize;
12748 fn deser(
12749 _version: MavlinkVersion,
12750 __input: &[u8],
12751 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12752 let avail_len = __input.len();
12753 let mut payload_buf = [0; Self::ENCODED_LEN];
12754 let mut buf = if avail_len < Self::ENCODED_LEN {
12755 payload_buf[0..avail_len].copy_from_slice(__input);
12756 Bytes::new(&payload_buf)
12757 } else {
12758 Bytes::new(__input)
12759 };
12760 let mut __struct = Self::default();
12761 __struct.arming_time_utc = buf.get_u64_le()?;
12762 __struct.takeoff_time_utc = buf.get_u64_le()?;
12763 __struct.flight_uuid = buf.get_u64_le()?;
12764 __struct.time_boot_ms = buf.get_u32_le()?;
12765 __struct.landing_time = buf.get_u32_le()?;
12766 Ok(__struct)
12767 }
12768 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12769 let mut __tmp = BytesMut::new(bytes);
12770 #[allow(clippy::absurd_extreme_comparisons)]
12771 #[allow(unused_comparisons)]
12772 if __tmp.remaining() < Self::ENCODED_LEN {
12773 panic!(
12774 "buffer is too small (need {} bytes, but got {})",
12775 Self::ENCODED_LEN,
12776 __tmp.remaining(),
12777 )
12778 }
12779 __tmp.put_u64_le(self.arming_time_utc);
12780 __tmp.put_u64_le(self.takeoff_time_utc);
12781 __tmp.put_u64_le(self.flight_uuid);
12782 __tmp.put_u32_le(self.time_boot_ms);
12783 if matches!(version, MavlinkVersion::V2) {
12784 __tmp.put_u32_le(self.landing_time);
12785 let len = __tmp.len();
12786 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12787 } else {
12788 __tmp.len()
12789 }
12790 }
12791}
12792#[doc = "Current motion information from a designated system."]
12793#[doc = ""]
12794#[doc = "ID: 144"]
12795#[derive(Debug, Clone, PartialEq)]
12796#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12797#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12798#[cfg_attr(feature = "ts", derive(TS))]
12799#[cfg_attr(feature = "ts", ts(export))]
12800pub struct FOLLOW_TARGET_DATA {
12801 #[doc = "Timestamp (time since system boot)."]
12802 pub timestamp: u64,
12803 #[doc = "button states or switches of a tracker device"]
12804 pub custom_state: u64,
12805 #[doc = "Latitude (WGS84)"]
12806 pub lat: i32,
12807 #[doc = "Longitude (WGS84)"]
12808 pub lon: i32,
12809 #[doc = "Altitude (MSL)"]
12810 pub alt: f32,
12811 #[doc = "target velocity (0,0,0) for unknown"]
12812 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12813 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12814 pub vel: [f32; 3],
12815 #[doc = "linear target acceleration (0,0,0) for unknown"]
12816 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12817 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12818 pub acc: [f32; 3],
12819 #[doc = "(0 0 0 0 for unknown)"]
12820 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12821 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12822 pub attitude_q: [f32; 4],
12823 #[doc = "(0 0 0 for unknown)"]
12824 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12825 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12826 pub rates: [f32; 3],
12827 #[doc = "eph epv"]
12828 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12829 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12830 pub position_cov: [f32; 3],
12831 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
12832 pub est_capabilities: u8,
12833}
12834impl FOLLOW_TARGET_DATA {
12835 pub const ENCODED_LEN: usize = 93usize;
12836 pub const DEFAULT: Self = Self {
12837 timestamp: 0_u64,
12838 custom_state: 0_u64,
12839 lat: 0_i32,
12840 lon: 0_i32,
12841 alt: 0.0_f32,
12842 vel: [0.0_f32; 3usize],
12843 acc: [0.0_f32; 3usize],
12844 attitude_q: [0.0_f32; 4usize],
12845 rates: [0.0_f32; 3usize],
12846 position_cov: [0.0_f32; 3usize],
12847 est_capabilities: 0_u8,
12848 };
12849 #[cfg(feature = "arbitrary")]
12850 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12851 use arbitrary::{Arbitrary, Unstructured};
12852 let mut buf = [0u8; 1024];
12853 rng.fill_bytes(&mut buf);
12854 let mut unstructured = Unstructured::new(&buf);
12855 Self::arbitrary(&mut unstructured).unwrap_or_default()
12856 }
12857}
12858impl Default for FOLLOW_TARGET_DATA {
12859 fn default() -> Self {
12860 Self::DEFAULT.clone()
12861 }
12862}
12863impl MessageData for FOLLOW_TARGET_DATA {
12864 type Message = MavMessage;
12865 const ID: u32 = 144u32;
12866 const NAME: &'static str = "FOLLOW_TARGET";
12867 const EXTRA_CRC: u8 = 127u8;
12868 const ENCODED_LEN: usize = 93usize;
12869 fn deser(
12870 _version: MavlinkVersion,
12871 __input: &[u8],
12872 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12873 let avail_len = __input.len();
12874 let mut payload_buf = [0; Self::ENCODED_LEN];
12875 let mut buf = if avail_len < Self::ENCODED_LEN {
12876 payload_buf[0..avail_len].copy_from_slice(__input);
12877 Bytes::new(&payload_buf)
12878 } else {
12879 Bytes::new(__input)
12880 };
12881 let mut __struct = Self::default();
12882 __struct.timestamp = buf.get_u64_le()?;
12883 __struct.custom_state = buf.get_u64_le()?;
12884 __struct.lat = buf.get_i32_le()?;
12885 __struct.lon = buf.get_i32_le()?;
12886 __struct.alt = buf.get_f32_le()?;
12887 for v in &mut __struct.vel {
12888 let val = buf.get_f32_le()?;
12889 *v = val;
12890 }
12891 for v in &mut __struct.acc {
12892 let val = buf.get_f32_le()?;
12893 *v = val;
12894 }
12895 for v in &mut __struct.attitude_q {
12896 let val = buf.get_f32_le()?;
12897 *v = val;
12898 }
12899 for v in &mut __struct.rates {
12900 let val = buf.get_f32_le()?;
12901 *v = val;
12902 }
12903 for v in &mut __struct.position_cov {
12904 let val = buf.get_f32_le()?;
12905 *v = val;
12906 }
12907 __struct.est_capabilities = buf.get_u8()?;
12908 Ok(__struct)
12909 }
12910 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12911 let mut __tmp = BytesMut::new(bytes);
12912 #[allow(clippy::absurd_extreme_comparisons)]
12913 #[allow(unused_comparisons)]
12914 if __tmp.remaining() < Self::ENCODED_LEN {
12915 panic!(
12916 "buffer is too small (need {} bytes, but got {})",
12917 Self::ENCODED_LEN,
12918 __tmp.remaining(),
12919 )
12920 }
12921 __tmp.put_u64_le(self.timestamp);
12922 __tmp.put_u64_le(self.custom_state);
12923 __tmp.put_i32_le(self.lat);
12924 __tmp.put_i32_le(self.lon);
12925 __tmp.put_f32_le(self.alt);
12926 for val in &self.vel {
12927 __tmp.put_f32_le(*val);
12928 }
12929 for val in &self.acc {
12930 __tmp.put_f32_le(*val);
12931 }
12932 for val in &self.attitude_q {
12933 __tmp.put_f32_le(*val);
12934 }
12935 for val in &self.rates {
12936 __tmp.put_f32_le(*val);
12937 }
12938 for val in &self.position_cov {
12939 __tmp.put_f32_le(*val);
12940 }
12941 __tmp.put_u8(self.est_capabilities);
12942 if matches!(version, MavlinkVersion::V2) {
12943 let len = __tmp.len();
12944 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12945 } else {
12946 __tmp.len()
12947 }
12948 }
12949}
12950#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
12951#[doc = ""]
12952#[doc = "ID: 371"]
12953#[derive(Debug, Clone, PartialEq)]
12954#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12955#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12956#[cfg_attr(feature = "ts", derive(TS))]
12957#[cfg_attr(feature = "ts", ts(export))]
12958pub struct FUEL_STATUS_DATA {
12959 #[doc = "Capacity when full. Must be provided."]
12960 pub maximum_fuel: f32,
12961 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12962 pub consumed_fuel: f32,
12963 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12964 pub remaining_fuel: f32,
12965 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
12966 pub flow_rate: f32,
12967 #[doc = "Fuel temperature. NaN: field not provided."]
12968 pub temperature: f32,
12969 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
12970 pub fuel_type: MavFuelType,
12971 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
12972 pub id: u8,
12973 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
12974 pub percent_remaining: u8,
12975}
12976impl FUEL_STATUS_DATA {
12977 pub const ENCODED_LEN: usize = 26usize;
12978 pub const DEFAULT: Self = Self {
12979 maximum_fuel: 0.0_f32,
12980 consumed_fuel: 0.0_f32,
12981 remaining_fuel: 0.0_f32,
12982 flow_rate: 0.0_f32,
12983 temperature: 0.0_f32,
12984 fuel_type: MavFuelType::DEFAULT,
12985 id: 0_u8,
12986 percent_remaining: 0_u8,
12987 };
12988 #[cfg(feature = "arbitrary")]
12989 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12990 use arbitrary::{Arbitrary, Unstructured};
12991 let mut buf = [0u8; 1024];
12992 rng.fill_bytes(&mut buf);
12993 let mut unstructured = Unstructured::new(&buf);
12994 Self::arbitrary(&mut unstructured).unwrap_or_default()
12995 }
12996}
12997impl Default for FUEL_STATUS_DATA {
12998 fn default() -> Self {
12999 Self::DEFAULT.clone()
13000 }
13001}
13002impl MessageData for FUEL_STATUS_DATA {
13003 type Message = MavMessage;
13004 const ID: u32 = 371u32;
13005 const NAME: &'static str = "FUEL_STATUS";
13006 const EXTRA_CRC: u8 = 10u8;
13007 const ENCODED_LEN: usize = 26usize;
13008 fn deser(
13009 _version: MavlinkVersion,
13010 __input: &[u8],
13011 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13012 let avail_len = __input.len();
13013 let mut payload_buf = [0; Self::ENCODED_LEN];
13014 let mut buf = if avail_len < Self::ENCODED_LEN {
13015 payload_buf[0..avail_len].copy_from_slice(__input);
13016 Bytes::new(&payload_buf)
13017 } else {
13018 Bytes::new(__input)
13019 };
13020 let mut __struct = Self::default();
13021 __struct.maximum_fuel = buf.get_f32_le()?;
13022 __struct.consumed_fuel = buf.get_f32_le()?;
13023 __struct.remaining_fuel = buf.get_f32_le()?;
13024 __struct.flow_rate = buf.get_f32_le()?;
13025 __struct.temperature = buf.get_f32_le()?;
13026 let tmp = buf.get_u32_le()?;
13027 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
13028 ::mavlink_core::error::ParserError::InvalidEnum {
13029 enum_type: "MavFuelType",
13030 value: tmp as u64,
13031 },
13032 )?;
13033 __struct.id = buf.get_u8()?;
13034 __struct.percent_remaining = buf.get_u8()?;
13035 Ok(__struct)
13036 }
13037 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13038 let mut __tmp = BytesMut::new(bytes);
13039 #[allow(clippy::absurd_extreme_comparisons)]
13040 #[allow(unused_comparisons)]
13041 if __tmp.remaining() < Self::ENCODED_LEN {
13042 panic!(
13043 "buffer is too small (need {} bytes, but got {})",
13044 Self::ENCODED_LEN,
13045 __tmp.remaining(),
13046 )
13047 }
13048 __tmp.put_f32_le(self.maximum_fuel);
13049 __tmp.put_f32_le(self.consumed_fuel);
13050 __tmp.put_f32_le(self.remaining_fuel);
13051 __tmp.put_f32_le(self.flow_rate);
13052 __tmp.put_f32_le(self.temperature);
13053 __tmp.put_u32_le(self.fuel_type as u32);
13054 __tmp.put_u8(self.id);
13055 __tmp.put_u8(self.percent_remaining);
13056 if matches!(version, MavlinkVersion::V2) {
13057 let len = __tmp.len();
13058 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13059 } else {
13060 __tmp.len()
13061 }
13062 }
13063}
13064#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
13065#[doc = ""]
13066#[doc = "ID: 373"]
13067#[derive(Debug, Clone, PartialEq)]
13068#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13069#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13070#[cfg_attr(feature = "ts", derive(TS))]
13071#[cfg_attr(feature = "ts", ts(export))]
13072pub struct GENERATOR_STATUS_DATA {
13073 #[doc = "Status flags."]
13074 pub status: MavGeneratorStatusFlag,
13075 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
13076 pub battery_current: f32,
13077 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
13078 pub load_current: f32,
13079 #[doc = "The power being generated. NaN: field not provided"]
13080 pub power_generated: f32,
13081 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
13082 pub bus_voltage: f32,
13083 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
13084 pub bat_current_setpoint: f32,
13085 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
13086 pub runtime: u32,
13087 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
13088 pub time_until_maintenance: i32,
13089 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
13090 pub generator_speed: u16,
13091 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
13092 pub rectifier_temperature: i16,
13093 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
13094 pub generator_temperature: i16,
13095}
13096impl GENERATOR_STATUS_DATA {
13097 pub const ENCODED_LEN: usize = 42usize;
13098 pub const DEFAULT: Self = Self {
13099 status: MavGeneratorStatusFlag::DEFAULT,
13100 battery_current: 0.0_f32,
13101 load_current: 0.0_f32,
13102 power_generated: 0.0_f32,
13103 bus_voltage: 0.0_f32,
13104 bat_current_setpoint: 0.0_f32,
13105 runtime: 0_u32,
13106 time_until_maintenance: 0_i32,
13107 generator_speed: 0_u16,
13108 rectifier_temperature: 0_i16,
13109 generator_temperature: 0_i16,
13110 };
13111 #[cfg(feature = "arbitrary")]
13112 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13113 use arbitrary::{Arbitrary, Unstructured};
13114 let mut buf = [0u8; 1024];
13115 rng.fill_bytes(&mut buf);
13116 let mut unstructured = Unstructured::new(&buf);
13117 Self::arbitrary(&mut unstructured).unwrap_or_default()
13118 }
13119}
13120impl Default for GENERATOR_STATUS_DATA {
13121 fn default() -> Self {
13122 Self::DEFAULT.clone()
13123 }
13124}
13125impl MessageData for GENERATOR_STATUS_DATA {
13126 type Message = MavMessage;
13127 const ID: u32 = 373u32;
13128 const NAME: &'static str = "GENERATOR_STATUS";
13129 const EXTRA_CRC: u8 = 117u8;
13130 const ENCODED_LEN: usize = 42usize;
13131 fn deser(
13132 _version: MavlinkVersion,
13133 __input: &[u8],
13134 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13135 let avail_len = __input.len();
13136 let mut payload_buf = [0; Self::ENCODED_LEN];
13137 let mut buf = if avail_len < Self::ENCODED_LEN {
13138 payload_buf[0..avail_len].copy_from_slice(__input);
13139 Bytes::new(&payload_buf)
13140 } else {
13141 Bytes::new(__input)
13142 };
13143 let mut __struct = Self::default();
13144 let tmp = buf.get_u64_le()?;
13145 __struct.status =
13146 MavGeneratorStatusFlag::from_bits(tmp as <MavGeneratorStatusFlag as Flags>::Bits)
13147 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13148 flag_type: "MavGeneratorStatusFlag",
13149 value: tmp as u64,
13150 })?;
13151 __struct.battery_current = buf.get_f32_le()?;
13152 __struct.load_current = buf.get_f32_le()?;
13153 __struct.power_generated = buf.get_f32_le()?;
13154 __struct.bus_voltage = buf.get_f32_le()?;
13155 __struct.bat_current_setpoint = buf.get_f32_le()?;
13156 __struct.runtime = buf.get_u32_le()?;
13157 __struct.time_until_maintenance = buf.get_i32_le()?;
13158 __struct.generator_speed = buf.get_u16_le()?;
13159 __struct.rectifier_temperature = buf.get_i16_le()?;
13160 __struct.generator_temperature = buf.get_i16_le()?;
13161 Ok(__struct)
13162 }
13163 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13164 let mut __tmp = BytesMut::new(bytes);
13165 #[allow(clippy::absurd_extreme_comparisons)]
13166 #[allow(unused_comparisons)]
13167 if __tmp.remaining() < Self::ENCODED_LEN {
13168 panic!(
13169 "buffer is too small (need {} bytes, but got {})",
13170 Self::ENCODED_LEN,
13171 __tmp.remaining(),
13172 )
13173 }
13174 __tmp.put_u64_le(self.status.bits() as u64);
13175 __tmp.put_f32_le(self.battery_current);
13176 __tmp.put_f32_le(self.load_current);
13177 __tmp.put_f32_le(self.power_generated);
13178 __tmp.put_f32_le(self.bus_voltage);
13179 __tmp.put_f32_le(self.bat_current_setpoint);
13180 __tmp.put_u32_le(self.runtime);
13181 __tmp.put_i32_le(self.time_until_maintenance);
13182 __tmp.put_u16_le(self.generator_speed);
13183 __tmp.put_i16_le(self.rectifier_temperature);
13184 __tmp.put_i16_le(self.generator_temperature);
13185 if matches!(version, MavlinkVersion::V2) {
13186 let len = __tmp.len();
13187 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13188 } else {
13189 __tmp.len()
13190 }
13191 }
13192}
13193#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
13194#[doc = ""]
13195#[doc = "ID: 285"]
13196#[derive(Debug, Clone, PartialEq)]
13197#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13198#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13199#[cfg_attr(feature = "ts", derive(TS))]
13200#[cfg_attr(feature = "ts", ts(export))]
13201pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
13202 #[doc = "Timestamp (time since system boot)."]
13203 pub time_boot_ms: u32,
13204 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
13205 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13206 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13207 pub q: [f32; 4],
13208 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
13209 pub angular_velocity_x: f32,
13210 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
13211 pub angular_velocity_y: f32,
13212 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
13213 pub angular_velocity_z: f32,
13214 #[doc = "Failure flags (0 for no failure)"]
13215 pub failure_flags: GimbalDeviceErrorFlags,
13216 #[doc = "Current gimbal flags set."]
13217 pub flags: GimbalDeviceFlags,
13218 #[doc = "System ID"]
13219 pub target_system: u8,
13220 #[doc = "Component ID"]
13221 pub target_component: u8,
13222 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
13223 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13224 pub delta_yaw: f32,
13225 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
13226 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13227 pub delta_yaw_velocity: f32,
13228 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
13229 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13230 pub gimbal_device_id: u8,
13231}
13232impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
13233 pub const ENCODED_LEN: usize = 49usize;
13234 pub const DEFAULT: Self = Self {
13235 time_boot_ms: 0_u32,
13236 q: [0.0_f32; 4usize],
13237 angular_velocity_x: 0.0_f32,
13238 angular_velocity_y: 0.0_f32,
13239 angular_velocity_z: 0.0_f32,
13240 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
13241 flags: GimbalDeviceFlags::DEFAULT,
13242 target_system: 0_u8,
13243 target_component: 0_u8,
13244 delta_yaw: 0.0_f32,
13245 delta_yaw_velocity: 0.0_f32,
13246 gimbal_device_id: 0_u8,
13247 };
13248 #[cfg(feature = "arbitrary")]
13249 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13250 use arbitrary::{Arbitrary, Unstructured};
13251 let mut buf = [0u8; 1024];
13252 rng.fill_bytes(&mut buf);
13253 let mut unstructured = Unstructured::new(&buf);
13254 Self::arbitrary(&mut unstructured).unwrap_or_default()
13255 }
13256}
13257impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
13258 fn default() -> Self {
13259 Self::DEFAULT.clone()
13260 }
13261}
13262impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
13263 type Message = MavMessage;
13264 const ID: u32 = 285u32;
13265 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
13266 const EXTRA_CRC: u8 = 137u8;
13267 const ENCODED_LEN: usize = 49usize;
13268 fn deser(
13269 _version: MavlinkVersion,
13270 __input: &[u8],
13271 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13272 let avail_len = __input.len();
13273 let mut payload_buf = [0; Self::ENCODED_LEN];
13274 let mut buf = if avail_len < Self::ENCODED_LEN {
13275 payload_buf[0..avail_len].copy_from_slice(__input);
13276 Bytes::new(&payload_buf)
13277 } else {
13278 Bytes::new(__input)
13279 };
13280 let mut __struct = Self::default();
13281 __struct.time_boot_ms = buf.get_u32_le()?;
13282 for v in &mut __struct.q {
13283 let val = buf.get_f32_le()?;
13284 *v = val;
13285 }
13286 __struct.angular_velocity_x = buf.get_f32_le()?;
13287 __struct.angular_velocity_y = buf.get_f32_le()?;
13288 __struct.angular_velocity_z = buf.get_f32_le()?;
13289 let tmp = buf.get_u32_le()?;
13290 __struct.failure_flags =
13291 GimbalDeviceErrorFlags::from_bits(tmp as <GimbalDeviceErrorFlags as Flags>::Bits)
13292 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13293 flag_type: "GimbalDeviceErrorFlags",
13294 value: tmp as u64,
13295 })?;
13296 let tmp = buf.get_u16_le()?;
13297 __struct.flags = GimbalDeviceFlags::from_bits(tmp as <GimbalDeviceFlags as Flags>::Bits)
13298 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13299 flag_type: "GimbalDeviceFlags",
13300 value: tmp as u64,
13301 })?;
13302 __struct.target_system = buf.get_u8()?;
13303 __struct.target_component = buf.get_u8()?;
13304 __struct.delta_yaw = buf.get_f32_le()?;
13305 __struct.delta_yaw_velocity = buf.get_f32_le()?;
13306 __struct.gimbal_device_id = buf.get_u8()?;
13307 Ok(__struct)
13308 }
13309 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13310 let mut __tmp = BytesMut::new(bytes);
13311 #[allow(clippy::absurd_extreme_comparisons)]
13312 #[allow(unused_comparisons)]
13313 if __tmp.remaining() < Self::ENCODED_LEN {
13314 panic!(
13315 "buffer is too small (need {} bytes, but got {})",
13316 Self::ENCODED_LEN,
13317 __tmp.remaining(),
13318 )
13319 }
13320 __tmp.put_u32_le(self.time_boot_ms);
13321 for val in &self.q {
13322 __tmp.put_f32_le(*val);
13323 }
13324 __tmp.put_f32_le(self.angular_velocity_x);
13325 __tmp.put_f32_le(self.angular_velocity_y);
13326 __tmp.put_f32_le(self.angular_velocity_z);
13327 __tmp.put_u32_le(self.failure_flags.bits() as u32);
13328 __tmp.put_u16_le(self.flags.bits() as u16);
13329 __tmp.put_u8(self.target_system);
13330 __tmp.put_u8(self.target_component);
13331 if matches!(version, MavlinkVersion::V2) {
13332 __tmp.put_f32_le(self.delta_yaw);
13333 __tmp.put_f32_le(self.delta_yaw_velocity);
13334 __tmp.put_u8(self.gimbal_device_id);
13335 let len = __tmp.len();
13336 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13337 } else {
13338 __tmp.len()
13339 }
13340 }
13341}
13342#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
13343#[doc = ""]
13344#[doc = "ID: 283"]
13345#[derive(Debug, Clone, PartialEq)]
13346#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13347#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13348#[cfg_attr(feature = "ts", derive(TS))]
13349#[cfg_attr(feature = "ts", ts(export))]
13350pub struct GIMBAL_DEVICE_INFORMATION_DATA {
13351 #[doc = "UID of gimbal hardware (0 if unknown)."]
13352 pub uid: u64,
13353 #[doc = "Timestamp (time since system boot)."]
13354 pub time_boot_ms: u32,
13355 #[doc = "0xff)."]
13356 pub firmware_version: u32,
13357 #[doc = "0xff)."]
13358 pub hardware_version: u32,
13359 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
13360 pub roll_min: f32,
13361 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
13362 pub roll_max: f32,
13363 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
13364 pub pitch_min: f32,
13365 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
13366 pub pitch_max: f32,
13367 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
13368 pub yaw_min: f32,
13369 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
13370 pub yaw_max: f32,
13371 #[doc = "Bitmap of gimbal capability flags."]
13372 pub cap_flags: GimbalDeviceCapFlags,
13373 #[doc = "Bitmap for use for gimbal-specific capability flags."]
13374 pub custom_cap_flags: u16,
13375 #[doc = "Name of the gimbal vendor."]
13376 #[cfg_attr(feature = "ts", ts(type = "string"))]
13377 pub vendor_name: CharArray<32>,
13378 #[doc = "Name of the gimbal model."]
13379 #[cfg_attr(feature = "ts", ts(type = "string"))]
13380 pub model_name: CharArray<32>,
13381 #[doc = "Custom name of the gimbal given to it by the user."]
13382 #[cfg_attr(feature = "ts", ts(type = "string"))]
13383 pub custom_name: CharArray<32>,
13384 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
13385 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13386 pub gimbal_device_id: u8,
13387}
13388impl GIMBAL_DEVICE_INFORMATION_DATA {
13389 pub const ENCODED_LEN: usize = 145usize;
13390 pub const DEFAULT: Self = Self {
13391 uid: 0_u64,
13392 time_boot_ms: 0_u32,
13393 firmware_version: 0_u32,
13394 hardware_version: 0_u32,
13395 roll_min: 0.0_f32,
13396 roll_max: 0.0_f32,
13397 pitch_min: 0.0_f32,
13398 pitch_max: 0.0_f32,
13399 yaw_min: 0.0_f32,
13400 yaw_max: 0.0_f32,
13401 cap_flags: GimbalDeviceCapFlags::DEFAULT,
13402 custom_cap_flags: 0_u16,
13403 vendor_name: CharArray::new([0_u8; 32usize]),
13404 model_name: CharArray::new([0_u8; 32usize]),
13405 custom_name: CharArray::new([0_u8; 32usize]),
13406 gimbal_device_id: 0_u8,
13407 };
13408 #[cfg(feature = "arbitrary")]
13409 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13410 use arbitrary::{Arbitrary, Unstructured};
13411 let mut buf = [0u8; 1024];
13412 rng.fill_bytes(&mut buf);
13413 let mut unstructured = Unstructured::new(&buf);
13414 Self::arbitrary(&mut unstructured).unwrap_or_default()
13415 }
13416}
13417impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
13418 fn default() -> Self {
13419 Self::DEFAULT.clone()
13420 }
13421}
13422impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
13423 type Message = MavMessage;
13424 const ID: u32 = 283u32;
13425 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
13426 const EXTRA_CRC: u8 = 74u8;
13427 const ENCODED_LEN: usize = 145usize;
13428 fn deser(
13429 _version: MavlinkVersion,
13430 __input: &[u8],
13431 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13432 let avail_len = __input.len();
13433 let mut payload_buf = [0; Self::ENCODED_LEN];
13434 let mut buf = if avail_len < Self::ENCODED_LEN {
13435 payload_buf[0..avail_len].copy_from_slice(__input);
13436 Bytes::new(&payload_buf)
13437 } else {
13438 Bytes::new(__input)
13439 };
13440 let mut __struct = Self::default();
13441 __struct.uid = buf.get_u64_le()?;
13442 __struct.time_boot_ms = buf.get_u32_le()?;
13443 __struct.firmware_version = buf.get_u32_le()?;
13444 __struct.hardware_version = buf.get_u32_le()?;
13445 __struct.roll_min = buf.get_f32_le()?;
13446 __struct.roll_max = buf.get_f32_le()?;
13447 __struct.pitch_min = buf.get_f32_le()?;
13448 __struct.pitch_max = buf.get_f32_le()?;
13449 __struct.yaw_min = buf.get_f32_le()?;
13450 __struct.yaw_max = buf.get_f32_le()?;
13451 let tmp = buf.get_u16_le()?;
13452 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
13453 tmp as <GimbalDeviceCapFlags as Flags>::Bits,
13454 )
13455 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13456 flag_type: "GimbalDeviceCapFlags",
13457 value: tmp as u64,
13458 })?;
13459 __struct.custom_cap_flags = buf.get_u16_le()?;
13460 let mut tmp = [0_u8; 32usize];
13461 for v in &mut tmp {
13462 *v = buf.get_u8()?;
13463 }
13464 __struct.vendor_name = CharArray::new(tmp);
13465 let mut tmp = [0_u8; 32usize];
13466 for v in &mut tmp {
13467 *v = buf.get_u8()?;
13468 }
13469 __struct.model_name = CharArray::new(tmp);
13470 let mut tmp = [0_u8; 32usize];
13471 for v in &mut tmp {
13472 *v = buf.get_u8()?;
13473 }
13474 __struct.custom_name = CharArray::new(tmp);
13475 __struct.gimbal_device_id = buf.get_u8()?;
13476 Ok(__struct)
13477 }
13478 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13479 let mut __tmp = BytesMut::new(bytes);
13480 #[allow(clippy::absurd_extreme_comparisons)]
13481 #[allow(unused_comparisons)]
13482 if __tmp.remaining() < Self::ENCODED_LEN {
13483 panic!(
13484 "buffer is too small (need {} bytes, but got {})",
13485 Self::ENCODED_LEN,
13486 __tmp.remaining(),
13487 )
13488 }
13489 __tmp.put_u64_le(self.uid);
13490 __tmp.put_u32_le(self.time_boot_ms);
13491 __tmp.put_u32_le(self.firmware_version);
13492 __tmp.put_u32_le(self.hardware_version);
13493 __tmp.put_f32_le(self.roll_min);
13494 __tmp.put_f32_le(self.roll_max);
13495 __tmp.put_f32_le(self.pitch_min);
13496 __tmp.put_f32_le(self.pitch_max);
13497 __tmp.put_f32_le(self.yaw_min);
13498 __tmp.put_f32_le(self.yaw_max);
13499 __tmp.put_u16_le(self.cap_flags.bits() as u16);
13500 __tmp.put_u16_le(self.custom_cap_flags);
13501 for val in &self.vendor_name {
13502 __tmp.put_u8(*val);
13503 }
13504 for val in &self.model_name {
13505 __tmp.put_u8(*val);
13506 }
13507 for val in &self.custom_name {
13508 __tmp.put_u8(*val);
13509 }
13510 if matches!(version, MavlinkVersion::V2) {
13511 __tmp.put_u8(self.gimbal_device_id);
13512 let len = __tmp.len();
13513 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13514 } else {
13515 __tmp.len()
13516 }
13517 }
13518}
13519#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
13520#[doc = ""]
13521#[doc = "ID: 284"]
13522#[derive(Debug, Clone, PartialEq)]
13523#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13524#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13525#[cfg_attr(feature = "ts", derive(TS))]
13526#[cfg_attr(feature = "ts", ts(export))]
13527pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13528 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
13529 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13530 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13531 pub q: [f32; 4],
13532 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
13533 pub angular_velocity_x: f32,
13534 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
13535 pub angular_velocity_y: f32,
13536 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
13537 pub angular_velocity_z: f32,
13538 #[doc = "Low level gimbal flags."]
13539 pub flags: GimbalDeviceFlags,
13540 #[doc = "System ID"]
13541 pub target_system: u8,
13542 #[doc = "Component ID"]
13543 pub target_component: u8,
13544}
13545impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13546 pub const ENCODED_LEN: usize = 32usize;
13547 pub const DEFAULT: Self = Self {
13548 q: [0.0_f32; 4usize],
13549 angular_velocity_x: 0.0_f32,
13550 angular_velocity_y: 0.0_f32,
13551 angular_velocity_z: 0.0_f32,
13552 flags: GimbalDeviceFlags::DEFAULT,
13553 target_system: 0_u8,
13554 target_component: 0_u8,
13555 };
13556 #[cfg(feature = "arbitrary")]
13557 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13558 use arbitrary::{Arbitrary, Unstructured};
13559 let mut buf = [0u8; 1024];
13560 rng.fill_bytes(&mut buf);
13561 let mut unstructured = Unstructured::new(&buf);
13562 Self::arbitrary(&mut unstructured).unwrap_or_default()
13563 }
13564}
13565impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13566 fn default() -> Self {
13567 Self::DEFAULT.clone()
13568 }
13569}
13570impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13571 type Message = MavMessage;
13572 const ID: u32 = 284u32;
13573 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
13574 const EXTRA_CRC: u8 = 99u8;
13575 const ENCODED_LEN: usize = 32usize;
13576 fn deser(
13577 _version: MavlinkVersion,
13578 __input: &[u8],
13579 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13580 let avail_len = __input.len();
13581 let mut payload_buf = [0; Self::ENCODED_LEN];
13582 let mut buf = if avail_len < Self::ENCODED_LEN {
13583 payload_buf[0..avail_len].copy_from_slice(__input);
13584 Bytes::new(&payload_buf)
13585 } else {
13586 Bytes::new(__input)
13587 };
13588 let mut __struct = Self::default();
13589 for v in &mut __struct.q {
13590 let val = buf.get_f32_le()?;
13591 *v = val;
13592 }
13593 __struct.angular_velocity_x = buf.get_f32_le()?;
13594 __struct.angular_velocity_y = buf.get_f32_le()?;
13595 __struct.angular_velocity_z = buf.get_f32_le()?;
13596 let tmp = buf.get_u16_le()?;
13597 __struct.flags = GimbalDeviceFlags::from_bits(tmp as <GimbalDeviceFlags as Flags>::Bits)
13598 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13599 flag_type: "GimbalDeviceFlags",
13600 value: tmp as u64,
13601 })?;
13602 __struct.target_system = buf.get_u8()?;
13603 __struct.target_component = buf.get_u8()?;
13604 Ok(__struct)
13605 }
13606 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13607 let mut __tmp = BytesMut::new(bytes);
13608 #[allow(clippy::absurd_extreme_comparisons)]
13609 #[allow(unused_comparisons)]
13610 if __tmp.remaining() < Self::ENCODED_LEN {
13611 panic!(
13612 "buffer is too small (need {} bytes, but got {})",
13613 Self::ENCODED_LEN,
13614 __tmp.remaining(),
13615 )
13616 }
13617 for val in &self.q {
13618 __tmp.put_f32_le(*val);
13619 }
13620 __tmp.put_f32_le(self.angular_velocity_x);
13621 __tmp.put_f32_le(self.angular_velocity_y);
13622 __tmp.put_f32_le(self.angular_velocity_z);
13623 __tmp.put_u16_le(self.flags.bits() as u16);
13624 __tmp.put_u8(self.target_system);
13625 __tmp.put_u8(self.target_component);
13626 if matches!(version, MavlinkVersion::V2) {
13627 let len = __tmp.len();
13628 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13629 } else {
13630 __tmp.len()
13631 }
13632 }
13633}
13634#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
13635#[doc = ""]
13636#[doc = "ID: 280"]
13637#[derive(Debug, Clone, PartialEq)]
13638#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13639#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13640#[cfg_attr(feature = "ts", derive(TS))]
13641#[cfg_attr(feature = "ts", ts(export))]
13642pub struct GIMBAL_MANAGER_INFORMATION_DATA {
13643 #[doc = "Timestamp (time since system boot)."]
13644 pub time_boot_ms: u32,
13645 #[doc = "Bitmap of gimbal capability flags."]
13646 pub cap_flags: GimbalManagerCapFlags,
13647 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
13648 pub roll_min: f32,
13649 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
13650 pub roll_max: f32,
13651 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
13652 pub pitch_min: f32,
13653 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
13654 pub pitch_max: f32,
13655 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
13656 pub yaw_min: f32,
13657 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
13658 pub yaw_max: f32,
13659 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
13660 pub gimbal_device_id: u8,
13661}
13662impl GIMBAL_MANAGER_INFORMATION_DATA {
13663 pub const ENCODED_LEN: usize = 33usize;
13664 pub const DEFAULT: Self = Self {
13665 time_boot_ms: 0_u32,
13666 cap_flags: GimbalManagerCapFlags::DEFAULT,
13667 roll_min: 0.0_f32,
13668 roll_max: 0.0_f32,
13669 pitch_min: 0.0_f32,
13670 pitch_max: 0.0_f32,
13671 yaw_min: 0.0_f32,
13672 yaw_max: 0.0_f32,
13673 gimbal_device_id: 0_u8,
13674 };
13675 #[cfg(feature = "arbitrary")]
13676 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13677 use arbitrary::{Arbitrary, Unstructured};
13678 let mut buf = [0u8; 1024];
13679 rng.fill_bytes(&mut buf);
13680 let mut unstructured = Unstructured::new(&buf);
13681 Self::arbitrary(&mut unstructured).unwrap_or_default()
13682 }
13683}
13684impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
13685 fn default() -> Self {
13686 Self::DEFAULT.clone()
13687 }
13688}
13689impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
13690 type Message = MavMessage;
13691 const ID: u32 = 280u32;
13692 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
13693 const EXTRA_CRC: u8 = 70u8;
13694 const ENCODED_LEN: usize = 33usize;
13695 fn deser(
13696 _version: MavlinkVersion,
13697 __input: &[u8],
13698 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13699 let avail_len = __input.len();
13700 let mut payload_buf = [0; Self::ENCODED_LEN];
13701 let mut buf = if avail_len < Self::ENCODED_LEN {
13702 payload_buf[0..avail_len].copy_from_slice(__input);
13703 Bytes::new(&payload_buf)
13704 } else {
13705 Bytes::new(__input)
13706 };
13707 let mut __struct = Self::default();
13708 __struct.time_boot_ms = buf.get_u32_le()?;
13709 let tmp = buf.get_u32_le()?;
13710 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
13711 tmp as <GimbalManagerCapFlags as Flags>::Bits,
13712 )
13713 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13714 flag_type: "GimbalManagerCapFlags",
13715 value: tmp as u64,
13716 })?;
13717 __struct.roll_min = buf.get_f32_le()?;
13718 __struct.roll_max = buf.get_f32_le()?;
13719 __struct.pitch_min = buf.get_f32_le()?;
13720 __struct.pitch_max = buf.get_f32_le()?;
13721 __struct.yaw_min = buf.get_f32_le()?;
13722 __struct.yaw_max = buf.get_f32_le()?;
13723 __struct.gimbal_device_id = buf.get_u8()?;
13724 Ok(__struct)
13725 }
13726 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13727 let mut __tmp = BytesMut::new(bytes);
13728 #[allow(clippy::absurd_extreme_comparisons)]
13729 #[allow(unused_comparisons)]
13730 if __tmp.remaining() < Self::ENCODED_LEN {
13731 panic!(
13732 "buffer is too small (need {} bytes, but got {})",
13733 Self::ENCODED_LEN,
13734 __tmp.remaining(),
13735 )
13736 }
13737 __tmp.put_u32_le(self.time_boot_ms);
13738 __tmp.put_u32_le(self.cap_flags.bits() as u32);
13739 __tmp.put_f32_le(self.roll_min);
13740 __tmp.put_f32_le(self.roll_max);
13741 __tmp.put_f32_le(self.pitch_min);
13742 __tmp.put_f32_le(self.pitch_max);
13743 __tmp.put_f32_le(self.yaw_min);
13744 __tmp.put_f32_le(self.yaw_max);
13745 __tmp.put_u8(self.gimbal_device_id);
13746 if matches!(version, MavlinkVersion::V2) {
13747 let len = __tmp.len();
13748 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13749 } else {
13750 __tmp.len()
13751 }
13752 }
13753}
13754#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13755#[doc = ""]
13756#[doc = "ID: 282"]
13757#[derive(Debug, Clone, PartialEq)]
13758#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13759#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13760#[cfg_attr(feature = "ts", derive(TS))]
13761#[cfg_attr(feature = "ts", ts(export))]
13762pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13763 #[doc = "High level gimbal manager flags to use."]
13764 pub flags: GimbalManagerFlags,
13765 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
13766 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13767 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13768 pub q: [f32; 4],
13769 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
13770 pub angular_velocity_x: f32,
13771 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
13772 pub angular_velocity_y: f32,
13773 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
13774 pub angular_velocity_z: f32,
13775 #[doc = "System ID"]
13776 pub target_system: u8,
13777 #[doc = "Component ID"]
13778 pub target_component: u8,
13779 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13780 pub gimbal_device_id: u8,
13781}
13782impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13783 pub const ENCODED_LEN: usize = 35usize;
13784 pub const DEFAULT: Self = Self {
13785 flags: GimbalManagerFlags::DEFAULT,
13786 q: [0.0_f32; 4usize],
13787 angular_velocity_x: 0.0_f32,
13788 angular_velocity_y: 0.0_f32,
13789 angular_velocity_z: 0.0_f32,
13790 target_system: 0_u8,
13791 target_component: 0_u8,
13792 gimbal_device_id: 0_u8,
13793 };
13794 #[cfg(feature = "arbitrary")]
13795 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13796 use arbitrary::{Arbitrary, Unstructured};
13797 let mut buf = [0u8; 1024];
13798 rng.fill_bytes(&mut buf);
13799 let mut unstructured = Unstructured::new(&buf);
13800 Self::arbitrary(&mut unstructured).unwrap_or_default()
13801 }
13802}
13803impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13804 fn default() -> Self {
13805 Self::DEFAULT.clone()
13806 }
13807}
13808impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13809 type Message = MavMessage;
13810 const ID: u32 = 282u32;
13811 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
13812 const EXTRA_CRC: u8 = 123u8;
13813 const ENCODED_LEN: usize = 35usize;
13814 fn deser(
13815 _version: MavlinkVersion,
13816 __input: &[u8],
13817 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13818 let avail_len = __input.len();
13819 let mut payload_buf = [0; Self::ENCODED_LEN];
13820 let mut buf = if avail_len < Self::ENCODED_LEN {
13821 payload_buf[0..avail_len].copy_from_slice(__input);
13822 Bytes::new(&payload_buf)
13823 } else {
13824 Bytes::new(__input)
13825 };
13826 let mut __struct = Self::default();
13827 let tmp = buf.get_u32_le()?;
13828 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
13829 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13830 flag_type: "GimbalManagerFlags",
13831 value: tmp as u64,
13832 })?;
13833 for v in &mut __struct.q {
13834 let val = buf.get_f32_le()?;
13835 *v = val;
13836 }
13837 __struct.angular_velocity_x = buf.get_f32_le()?;
13838 __struct.angular_velocity_y = buf.get_f32_le()?;
13839 __struct.angular_velocity_z = buf.get_f32_le()?;
13840 __struct.target_system = buf.get_u8()?;
13841 __struct.target_component = buf.get_u8()?;
13842 __struct.gimbal_device_id = buf.get_u8()?;
13843 Ok(__struct)
13844 }
13845 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13846 let mut __tmp = BytesMut::new(bytes);
13847 #[allow(clippy::absurd_extreme_comparisons)]
13848 #[allow(unused_comparisons)]
13849 if __tmp.remaining() < Self::ENCODED_LEN {
13850 panic!(
13851 "buffer is too small (need {} bytes, but got {})",
13852 Self::ENCODED_LEN,
13853 __tmp.remaining(),
13854 )
13855 }
13856 __tmp.put_u32_le(self.flags.bits() as u32);
13857 for val in &self.q {
13858 __tmp.put_f32_le(*val);
13859 }
13860 __tmp.put_f32_le(self.angular_velocity_x);
13861 __tmp.put_f32_le(self.angular_velocity_y);
13862 __tmp.put_f32_le(self.angular_velocity_z);
13863 __tmp.put_u8(self.target_system);
13864 __tmp.put_u8(self.target_component);
13865 __tmp.put_u8(self.gimbal_device_id);
13866 if matches!(version, MavlinkVersion::V2) {
13867 let len = __tmp.len();
13868 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13869 } else {
13870 __tmp.len()
13871 }
13872 }
13873}
13874#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13875#[doc = ""]
13876#[doc = "ID: 288"]
13877#[derive(Debug, Clone, PartialEq)]
13878#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13879#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13880#[cfg_attr(feature = "ts", derive(TS))]
13881#[cfg_attr(feature = "ts", ts(export))]
13882pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13883 #[doc = "High level gimbal manager flags."]
13884 pub flags: GimbalManagerFlags,
13885 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
13886 pub pitch: f32,
13887 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
13888 pub yaw: f32,
13889 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
13890 pub pitch_rate: f32,
13891 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
13892 pub yaw_rate: f32,
13893 #[doc = "System ID"]
13894 pub target_system: u8,
13895 #[doc = "Component ID"]
13896 pub target_component: u8,
13897 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13898 pub gimbal_device_id: u8,
13899}
13900impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13901 pub const ENCODED_LEN: usize = 23usize;
13902 pub const DEFAULT: Self = Self {
13903 flags: GimbalManagerFlags::DEFAULT,
13904 pitch: 0.0_f32,
13905 yaw: 0.0_f32,
13906 pitch_rate: 0.0_f32,
13907 yaw_rate: 0.0_f32,
13908 target_system: 0_u8,
13909 target_component: 0_u8,
13910 gimbal_device_id: 0_u8,
13911 };
13912 #[cfg(feature = "arbitrary")]
13913 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13914 use arbitrary::{Arbitrary, Unstructured};
13915 let mut buf = [0u8; 1024];
13916 rng.fill_bytes(&mut buf);
13917 let mut unstructured = Unstructured::new(&buf);
13918 Self::arbitrary(&mut unstructured).unwrap_or_default()
13919 }
13920}
13921impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13922 fn default() -> Self {
13923 Self::DEFAULT.clone()
13924 }
13925}
13926impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13927 type Message = MavMessage;
13928 const ID: u32 = 288u32;
13929 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
13930 const EXTRA_CRC: u8 = 20u8;
13931 const ENCODED_LEN: usize = 23usize;
13932 fn deser(
13933 _version: MavlinkVersion,
13934 __input: &[u8],
13935 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13936 let avail_len = __input.len();
13937 let mut payload_buf = [0; Self::ENCODED_LEN];
13938 let mut buf = if avail_len < Self::ENCODED_LEN {
13939 payload_buf[0..avail_len].copy_from_slice(__input);
13940 Bytes::new(&payload_buf)
13941 } else {
13942 Bytes::new(__input)
13943 };
13944 let mut __struct = Self::default();
13945 let tmp = buf.get_u32_le()?;
13946 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
13947 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13948 flag_type: "GimbalManagerFlags",
13949 value: tmp as u64,
13950 })?;
13951 __struct.pitch = buf.get_f32_le()?;
13952 __struct.yaw = buf.get_f32_le()?;
13953 __struct.pitch_rate = buf.get_f32_le()?;
13954 __struct.yaw_rate = buf.get_f32_le()?;
13955 __struct.target_system = buf.get_u8()?;
13956 __struct.target_component = buf.get_u8()?;
13957 __struct.gimbal_device_id = buf.get_u8()?;
13958 Ok(__struct)
13959 }
13960 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13961 let mut __tmp = BytesMut::new(bytes);
13962 #[allow(clippy::absurd_extreme_comparisons)]
13963 #[allow(unused_comparisons)]
13964 if __tmp.remaining() < Self::ENCODED_LEN {
13965 panic!(
13966 "buffer is too small (need {} bytes, but got {})",
13967 Self::ENCODED_LEN,
13968 __tmp.remaining(),
13969 )
13970 }
13971 __tmp.put_u32_le(self.flags.bits() as u32);
13972 __tmp.put_f32_le(self.pitch);
13973 __tmp.put_f32_le(self.yaw);
13974 __tmp.put_f32_le(self.pitch_rate);
13975 __tmp.put_f32_le(self.yaw_rate);
13976 __tmp.put_u8(self.target_system);
13977 __tmp.put_u8(self.target_component);
13978 __tmp.put_u8(self.gimbal_device_id);
13979 if matches!(version, MavlinkVersion::V2) {
13980 let len = __tmp.len();
13981 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13982 } else {
13983 __tmp.len()
13984 }
13985 }
13986}
13987#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
13988#[doc = ""]
13989#[doc = "ID: 287"]
13990#[derive(Debug, Clone, PartialEq)]
13991#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13992#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13993#[cfg_attr(feature = "ts", derive(TS))]
13994#[cfg_attr(feature = "ts", ts(export))]
13995pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13996 #[doc = "High level gimbal manager flags to use."]
13997 pub flags: GimbalManagerFlags,
13998 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
13999 pub pitch: f32,
14000 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
14001 pub yaw: f32,
14002 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
14003 pub pitch_rate: f32,
14004 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
14005 pub yaw_rate: f32,
14006 #[doc = "System ID"]
14007 pub target_system: u8,
14008 #[doc = "Component ID"]
14009 pub target_component: u8,
14010 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
14011 pub gimbal_device_id: u8,
14012}
14013impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
14014 pub const ENCODED_LEN: usize = 23usize;
14015 pub const DEFAULT: Self = Self {
14016 flags: GimbalManagerFlags::DEFAULT,
14017 pitch: 0.0_f32,
14018 yaw: 0.0_f32,
14019 pitch_rate: 0.0_f32,
14020 yaw_rate: 0.0_f32,
14021 target_system: 0_u8,
14022 target_component: 0_u8,
14023 gimbal_device_id: 0_u8,
14024 };
14025 #[cfg(feature = "arbitrary")]
14026 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14027 use arbitrary::{Arbitrary, Unstructured};
14028 let mut buf = [0u8; 1024];
14029 rng.fill_bytes(&mut buf);
14030 let mut unstructured = Unstructured::new(&buf);
14031 Self::arbitrary(&mut unstructured).unwrap_or_default()
14032 }
14033}
14034impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
14035 fn default() -> Self {
14036 Self::DEFAULT.clone()
14037 }
14038}
14039impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
14040 type Message = MavMessage;
14041 const ID: u32 = 287u32;
14042 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
14043 const EXTRA_CRC: u8 = 1u8;
14044 const ENCODED_LEN: usize = 23usize;
14045 fn deser(
14046 _version: MavlinkVersion,
14047 __input: &[u8],
14048 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14049 let avail_len = __input.len();
14050 let mut payload_buf = [0; Self::ENCODED_LEN];
14051 let mut buf = if avail_len < Self::ENCODED_LEN {
14052 payload_buf[0..avail_len].copy_from_slice(__input);
14053 Bytes::new(&payload_buf)
14054 } else {
14055 Bytes::new(__input)
14056 };
14057 let mut __struct = Self::default();
14058 let tmp = buf.get_u32_le()?;
14059 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
14060 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14061 flag_type: "GimbalManagerFlags",
14062 value: tmp as u64,
14063 })?;
14064 __struct.pitch = buf.get_f32_le()?;
14065 __struct.yaw = buf.get_f32_le()?;
14066 __struct.pitch_rate = buf.get_f32_le()?;
14067 __struct.yaw_rate = buf.get_f32_le()?;
14068 __struct.target_system = buf.get_u8()?;
14069 __struct.target_component = buf.get_u8()?;
14070 __struct.gimbal_device_id = buf.get_u8()?;
14071 Ok(__struct)
14072 }
14073 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14074 let mut __tmp = BytesMut::new(bytes);
14075 #[allow(clippy::absurd_extreme_comparisons)]
14076 #[allow(unused_comparisons)]
14077 if __tmp.remaining() < Self::ENCODED_LEN {
14078 panic!(
14079 "buffer is too small (need {} bytes, but got {})",
14080 Self::ENCODED_LEN,
14081 __tmp.remaining(),
14082 )
14083 }
14084 __tmp.put_u32_le(self.flags.bits() as u32);
14085 __tmp.put_f32_le(self.pitch);
14086 __tmp.put_f32_le(self.yaw);
14087 __tmp.put_f32_le(self.pitch_rate);
14088 __tmp.put_f32_le(self.yaw_rate);
14089 __tmp.put_u8(self.target_system);
14090 __tmp.put_u8(self.target_component);
14091 __tmp.put_u8(self.gimbal_device_id);
14092 if matches!(version, MavlinkVersion::V2) {
14093 let len = __tmp.len();
14094 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14095 } else {
14096 __tmp.len()
14097 }
14098 }
14099}
14100#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
14101#[doc = ""]
14102#[doc = "ID: 281"]
14103#[derive(Debug, Clone, PartialEq)]
14104#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14105#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14106#[cfg_attr(feature = "ts", derive(TS))]
14107#[cfg_attr(feature = "ts", ts(export))]
14108pub struct GIMBAL_MANAGER_STATUS_DATA {
14109 #[doc = "Timestamp (time since system boot)."]
14110 pub time_boot_ms: u32,
14111 #[doc = "High level gimbal manager flags currently applied."]
14112 pub flags: GimbalManagerFlags,
14113 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
14114 pub gimbal_device_id: u8,
14115 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
14116 pub primary_control_sysid: u8,
14117 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
14118 pub primary_control_compid: u8,
14119 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
14120 pub secondary_control_sysid: u8,
14121 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
14122 pub secondary_control_compid: u8,
14123}
14124impl GIMBAL_MANAGER_STATUS_DATA {
14125 pub const ENCODED_LEN: usize = 13usize;
14126 pub const DEFAULT: Self = Self {
14127 time_boot_ms: 0_u32,
14128 flags: GimbalManagerFlags::DEFAULT,
14129 gimbal_device_id: 0_u8,
14130 primary_control_sysid: 0_u8,
14131 primary_control_compid: 0_u8,
14132 secondary_control_sysid: 0_u8,
14133 secondary_control_compid: 0_u8,
14134 };
14135 #[cfg(feature = "arbitrary")]
14136 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14137 use arbitrary::{Arbitrary, Unstructured};
14138 let mut buf = [0u8; 1024];
14139 rng.fill_bytes(&mut buf);
14140 let mut unstructured = Unstructured::new(&buf);
14141 Self::arbitrary(&mut unstructured).unwrap_or_default()
14142 }
14143}
14144impl Default for GIMBAL_MANAGER_STATUS_DATA {
14145 fn default() -> Self {
14146 Self::DEFAULT.clone()
14147 }
14148}
14149impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
14150 type Message = MavMessage;
14151 const ID: u32 = 281u32;
14152 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
14153 const EXTRA_CRC: u8 = 48u8;
14154 const ENCODED_LEN: usize = 13usize;
14155 fn deser(
14156 _version: MavlinkVersion,
14157 __input: &[u8],
14158 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14159 let avail_len = __input.len();
14160 let mut payload_buf = [0; Self::ENCODED_LEN];
14161 let mut buf = if avail_len < Self::ENCODED_LEN {
14162 payload_buf[0..avail_len].copy_from_slice(__input);
14163 Bytes::new(&payload_buf)
14164 } else {
14165 Bytes::new(__input)
14166 };
14167 let mut __struct = Self::default();
14168 __struct.time_boot_ms = buf.get_u32_le()?;
14169 let tmp = buf.get_u32_le()?;
14170 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
14171 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14172 flag_type: "GimbalManagerFlags",
14173 value: tmp as u64,
14174 })?;
14175 __struct.gimbal_device_id = buf.get_u8()?;
14176 __struct.primary_control_sysid = buf.get_u8()?;
14177 __struct.primary_control_compid = buf.get_u8()?;
14178 __struct.secondary_control_sysid = buf.get_u8()?;
14179 __struct.secondary_control_compid = buf.get_u8()?;
14180 Ok(__struct)
14181 }
14182 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14183 let mut __tmp = BytesMut::new(bytes);
14184 #[allow(clippy::absurd_extreme_comparisons)]
14185 #[allow(unused_comparisons)]
14186 if __tmp.remaining() < Self::ENCODED_LEN {
14187 panic!(
14188 "buffer is too small (need {} bytes, but got {})",
14189 Self::ENCODED_LEN,
14190 __tmp.remaining(),
14191 )
14192 }
14193 __tmp.put_u32_le(self.time_boot_ms);
14194 __tmp.put_u32_le(self.flags.bits() as u32);
14195 __tmp.put_u8(self.gimbal_device_id);
14196 __tmp.put_u8(self.primary_control_sysid);
14197 __tmp.put_u8(self.primary_control_compid);
14198 __tmp.put_u8(self.secondary_control_sysid);
14199 __tmp.put_u8(self.secondary_control_compid);
14200 if matches!(version, MavlinkVersion::V2) {
14201 let len = __tmp.len();
14202 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14203 } else {
14204 __tmp.len()
14205 }
14206 }
14207}
14208#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
14209#[doc = ""]
14210#[doc = "ID: 33"]
14211#[derive(Debug, Clone, PartialEq)]
14212#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14213#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14214#[cfg_attr(feature = "ts", derive(TS))]
14215#[cfg_attr(feature = "ts", ts(export))]
14216pub struct GLOBAL_POSITION_INT_DATA {
14217 #[doc = "Timestamp (time since system boot)."]
14218 pub time_boot_ms: u32,
14219 #[doc = "Latitude, expressed"]
14220 pub lat: i32,
14221 #[doc = "Longitude, expressed"]
14222 pub lon: i32,
14223 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
14224 pub alt: i32,
14225 #[doc = "Altitude above home"]
14226 pub relative_alt: i32,
14227 #[doc = "Ground X Speed (Latitude, positive north)"]
14228 pub vx: i16,
14229 #[doc = "Ground Y Speed (Longitude, positive east)"]
14230 pub vy: i16,
14231 #[doc = "Ground Z Speed (Altitude, positive down)"]
14232 pub vz: i16,
14233 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14234 pub hdg: u16,
14235}
14236impl GLOBAL_POSITION_INT_DATA {
14237 pub const ENCODED_LEN: usize = 28usize;
14238 pub const DEFAULT: Self = Self {
14239 time_boot_ms: 0_u32,
14240 lat: 0_i32,
14241 lon: 0_i32,
14242 alt: 0_i32,
14243 relative_alt: 0_i32,
14244 vx: 0_i16,
14245 vy: 0_i16,
14246 vz: 0_i16,
14247 hdg: 0_u16,
14248 };
14249 #[cfg(feature = "arbitrary")]
14250 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14251 use arbitrary::{Arbitrary, Unstructured};
14252 let mut buf = [0u8; 1024];
14253 rng.fill_bytes(&mut buf);
14254 let mut unstructured = Unstructured::new(&buf);
14255 Self::arbitrary(&mut unstructured).unwrap_or_default()
14256 }
14257}
14258impl Default for GLOBAL_POSITION_INT_DATA {
14259 fn default() -> Self {
14260 Self::DEFAULT.clone()
14261 }
14262}
14263impl MessageData for GLOBAL_POSITION_INT_DATA {
14264 type Message = MavMessage;
14265 const ID: u32 = 33u32;
14266 const NAME: &'static str = "GLOBAL_POSITION_INT";
14267 const EXTRA_CRC: u8 = 104u8;
14268 const ENCODED_LEN: usize = 28usize;
14269 fn deser(
14270 _version: MavlinkVersion,
14271 __input: &[u8],
14272 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14273 let avail_len = __input.len();
14274 let mut payload_buf = [0; Self::ENCODED_LEN];
14275 let mut buf = if avail_len < Self::ENCODED_LEN {
14276 payload_buf[0..avail_len].copy_from_slice(__input);
14277 Bytes::new(&payload_buf)
14278 } else {
14279 Bytes::new(__input)
14280 };
14281 let mut __struct = Self::default();
14282 __struct.time_boot_ms = buf.get_u32_le()?;
14283 __struct.lat = buf.get_i32_le()?;
14284 __struct.lon = buf.get_i32_le()?;
14285 __struct.alt = buf.get_i32_le()?;
14286 __struct.relative_alt = buf.get_i32_le()?;
14287 __struct.vx = buf.get_i16_le()?;
14288 __struct.vy = buf.get_i16_le()?;
14289 __struct.vz = buf.get_i16_le()?;
14290 __struct.hdg = buf.get_u16_le()?;
14291 Ok(__struct)
14292 }
14293 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14294 let mut __tmp = BytesMut::new(bytes);
14295 #[allow(clippy::absurd_extreme_comparisons)]
14296 #[allow(unused_comparisons)]
14297 if __tmp.remaining() < Self::ENCODED_LEN {
14298 panic!(
14299 "buffer is too small (need {} bytes, but got {})",
14300 Self::ENCODED_LEN,
14301 __tmp.remaining(),
14302 )
14303 }
14304 __tmp.put_u32_le(self.time_boot_ms);
14305 __tmp.put_i32_le(self.lat);
14306 __tmp.put_i32_le(self.lon);
14307 __tmp.put_i32_le(self.alt);
14308 __tmp.put_i32_le(self.relative_alt);
14309 __tmp.put_i16_le(self.vx);
14310 __tmp.put_i16_le(self.vy);
14311 __tmp.put_i16_le(self.vz);
14312 __tmp.put_u16_le(self.hdg);
14313 if matches!(version, MavlinkVersion::V2) {
14314 let len = __tmp.len();
14315 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14316 } else {
14317 __tmp.len()
14318 }
14319 }
14320}
14321#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
14322#[doc = ""]
14323#[doc = "ID: 63"]
14324#[derive(Debug, Clone, PartialEq)]
14325#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14326#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14327#[cfg_attr(feature = "ts", derive(TS))]
14328#[cfg_attr(feature = "ts", ts(export))]
14329pub struct GLOBAL_POSITION_INT_COV_DATA {
14330 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14331 pub time_usec: u64,
14332 #[doc = "Latitude"]
14333 pub lat: i32,
14334 #[doc = "Longitude"]
14335 pub lon: i32,
14336 #[doc = "Altitude in meters above MSL"]
14337 pub alt: i32,
14338 #[doc = "Altitude above ground"]
14339 pub relative_alt: i32,
14340 #[doc = "Ground X Speed (Latitude)"]
14341 pub vx: f32,
14342 #[doc = "Ground Y Speed (Longitude)"]
14343 pub vy: f32,
14344 #[doc = "Ground Z Speed (Altitude)"]
14345 pub vz: f32,
14346 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
14347 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14348 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14349 pub covariance: [f32; 36],
14350 #[doc = "Class id of the estimator this estimate originated from."]
14351 pub estimator_type: MavEstimatorType,
14352}
14353impl GLOBAL_POSITION_INT_COV_DATA {
14354 pub const ENCODED_LEN: usize = 181usize;
14355 pub const DEFAULT: Self = Self {
14356 time_usec: 0_u64,
14357 lat: 0_i32,
14358 lon: 0_i32,
14359 alt: 0_i32,
14360 relative_alt: 0_i32,
14361 vx: 0.0_f32,
14362 vy: 0.0_f32,
14363 vz: 0.0_f32,
14364 covariance: [0.0_f32; 36usize],
14365 estimator_type: MavEstimatorType::DEFAULT,
14366 };
14367 #[cfg(feature = "arbitrary")]
14368 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14369 use arbitrary::{Arbitrary, Unstructured};
14370 let mut buf = [0u8; 1024];
14371 rng.fill_bytes(&mut buf);
14372 let mut unstructured = Unstructured::new(&buf);
14373 Self::arbitrary(&mut unstructured).unwrap_or_default()
14374 }
14375}
14376impl Default for GLOBAL_POSITION_INT_COV_DATA {
14377 fn default() -> Self {
14378 Self::DEFAULT.clone()
14379 }
14380}
14381impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
14382 type Message = MavMessage;
14383 const ID: u32 = 63u32;
14384 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
14385 const EXTRA_CRC: u8 = 119u8;
14386 const ENCODED_LEN: usize = 181usize;
14387 fn deser(
14388 _version: MavlinkVersion,
14389 __input: &[u8],
14390 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14391 let avail_len = __input.len();
14392 let mut payload_buf = [0; Self::ENCODED_LEN];
14393 let mut buf = if avail_len < Self::ENCODED_LEN {
14394 payload_buf[0..avail_len].copy_from_slice(__input);
14395 Bytes::new(&payload_buf)
14396 } else {
14397 Bytes::new(__input)
14398 };
14399 let mut __struct = Self::default();
14400 __struct.time_usec = buf.get_u64_le()?;
14401 __struct.lat = buf.get_i32_le()?;
14402 __struct.lon = buf.get_i32_le()?;
14403 __struct.alt = buf.get_i32_le()?;
14404 __struct.relative_alt = buf.get_i32_le()?;
14405 __struct.vx = buf.get_f32_le()?;
14406 __struct.vy = buf.get_f32_le()?;
14407 __struct.vz = buf.get_f32_le()?;
14408 for v in &mut __struct.covariance {
14409 let val = buf.get_f32_le()?;
14410 *v = val;
14411 }
14412 let tmp = buf.get_u8()?;
14413 __struct.estimator_type =
14414 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14415 enum_type: "MavEstimatorType",
14416 value: tmp as u64,
14417 })?;
14418 Ok(__struct)
14419 }
14420 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14421 let mut __tmp = BytesMut::new(bytes);
14422 #[allow(clippy::absurd_extreme_comparisons)]
14423 #[allow(unused_comparisons)]
14424 if __tmp.remaining() < Self::ENCODED_LEN {
14425 panic!(
14426 "buffer is too small (need {} bytes, but got {})",
14427 Self::ENCODED_LEN,
14428 __tmp.remaining(),
14429 )
14430 }
14431 __tmp.put_u64_le(self.time_usec);
14432 __tmp.put_i32_le(self.lat);
14433 __tmp.put_i32_le(self.lon);
14434 __tmp.put_i32_le(self.alt);
14435 __tmp.put_i32_le(self.relative_alt);
14436 __tmp.put_f32_le(self.vx);
14437 __tmp.put_f32_le(self.vy);
14438 __tmp.put_f32_le(self.vz);
14439 for val in &self.covariance {
14440 __tmp.put_f32_le(*val);
14441 }
14442 __tmp.put_u8(self.estimator_type as u8);
14443 if matches!(version, MavlinkVersion::V2) {
14444 let len = __tmp.len();
14445 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14446 } else {
14447 __tmp.len()
14448 }
14449 }
14450}
14451#[doc = "Global position/attitude estimate from a vision source."]
14452#[doc = ""]
14453#[doc = "ID: 101"]
14454#[derive(Debug, Clone, PartialEq)]
14455#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14456#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14457#[cfg_attr(feature = "ts", derive(TS))]
14458#[cfg_attr(feature = "ts", ts(export))]
14459pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14460 #[doc = "Timestamp (UNIX time or since system boot)"]
14461 pub usec: u64,
14462 #[doc = "Global X position"]
14463 pub x: f32,
14464 #[doc = "Global Y position"]
14465 pub y: f32,
14466 #[doc = "Global Z position"]
14467 pub z: f32,
14468 #[doc = "Roll angle"]
14469 pub roll: f32,
14470 #[doc = "Pitch angle"]
14471 pub pitch: f32,
14472 #[doc = "Yaw angle"]
14473 pub yaw: f32,
14474 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
14475 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14476 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14477 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14478 pub covariance: [f32; 21],
14479 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
14480 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14481 pub reset_counter: u8,
14482}
14483impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14484 pub const ENCODED_LEN: usize = 117usize;
14485 pub const DEFAULT: Self = Self {
14486 usec: 0_u64,
14487 x: 0.0_f32,
14488 y: 0.0_f32,
14489 z: 0.0_f32,
14490 roll: 0.0_f32,
14491 pitch: 0.0_f32,
14492 yaw: 0.0_f32,
14493 covariance: [0.0_f32; 21usize],
14494 reset_counter: 0_u8,
14495 };
14496 #[cfg(feature = "arbitrary")]
14497 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14498 use arbitrary::{Arbitrary, Unstructured};
14499 let mut buf = [0u8; 1024];
14500 rng.fill_bytes(&mut buf);
14501 let mut unstructured = Unstructured::new(&buf);
14502 Self::arbitrary(&mut unstructured).unwrap_or_default()
14503 }
14504}
14505impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14506 fn default() -> Self {
14507 Self::DEFAULT.clone()
14508 }
14509}
14510impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14511 type Message = MavMessage;
14512 const ID: u32 = 101u32;
14513 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
14514 const EXTRA_CRC: u8 = 102u8;
14515 const ENCODED_LEN: usize = 117usize;
14516 fn deser(
14517 _version: MavlinkVersion,
14518 __input: &[u8],
14519 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14520 let avail_len = __input.len();
14521 let mut payload_buf = [0; Self::ENCODED_LEN];
14522 let mut buf = if avail_len < Self::ENCODED_LEN {
14523 payload_buf[0..avail_len].copy_from_slice(__input);
14524 Bytes::new(&payload_buf)
14525 } else {
14526 Bytes::new(__input)
14527 };
14528 let mut __struct = Self::default();
14529 __struct.usec = buf.get_u64_le()?;
14530 __struct.x = buf.get_f32_le()?;
14531 __struct.y = buf.get_f32_le()?;
14532 __struct.z = buf.get_f32_le()?;
14533 __struct.roll = buf.get_f32_le()?;
14534 __struct.pitch = buf.get_f32_le()?;
14535 __struct.yaw = buf.get_f32_le()?;
14536 for v in &mut __struct.covariance {
14537 let val = buf.get_f32_le()?;
14538 *v = val;
14539 }
14540 __struct.reset_counter = buf.get_u8()?;
14541 Ok(__struct)
14542 }
14543 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14544 let mut __tmp = BytesMut::new(bytes);
14545 #[allow(clippy::absurd_extreme_comparisons)]
14546 #[allow(unused_comparisons)]
14547 if __tmp.remaining() < Self::ENCODED_LEN {
14548 panic!(
14549 "buffer is too small (need {} bytes, but got {})",
14550 Self::ENCODED_LEN,
14551 __tmp.remaining(),
14552 )
14553 }
14554 __tmp.put_u64_le(self.usec);
14555 __tmp.put_f32_le(self.x);
14556 __tmp.put_f32_le(self.y);
14557 __tmp.put_f32_le(self.z);
14558 __tmp.put_f32_le(self.roll);
14559 __tmp.put_f32_le(self.pitch);
14560 __tmp.put_f32_le(self.yaw);
14561 if matches!(version, MavlinkVersion::V2) {
14562 for val in &self.covariance {
14563 __tmp.put_f32_le(*val);
14564 }
14565 __tmp.put_u8(self.reset_counter);
14566 let len = __tmp.len();
14567 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14568 } else {
14569 __tmp.len()
14570 }
14571 }
14572}
14573#[doc = "Second GPS data."]
14574#[doc = ""]
14575#[doc = "ID: 124"]
14576#[derive(Debug, Clone, PartialEq)]
14577#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14578#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14579#[cfg_attr(feature = "ts", derive(TS))]
14580#[cfg_attr(feature = "ts", ts(export))]
14581pub struct GPS2_RAW_DATA {
14582 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14583 pub time_usec: u64,
14584 #[doc = "Latitude (WGS84)"]
14585 pub lat: i32,
14586 #[doc = "Longitude (WGS84)"]
14587 pub lon: i32,
14588 #[doc = "Altitude (MSL). Positive for up."]
14589 pub alt: i32,
14590 #[doc = "Age of DGPS info"]
14591 pub dgps_age: u32,
14592 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14593 pub eph: u16,
14594 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14595 pub epv: u16,
14596 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
14597 pub vel: u16,
14598 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14599 pub cog: u16,
14600 #[doc = "GPS fix type."]
14601 pub fix_type: GpsFixType,
14602 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14603 pub satellites_visible: u8,
14604 #[doc = "Number of DGPS satellites"]
14605 pub dgps_numch: u8,
14606 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
14607 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14608 pub yaw: u16,
14609 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
14610 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14611 pub alt_ellipsoid: i32,
14612 #[doc = "Position uncertainty."]
14613 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14614 pub h_acc: u32,
14615 #[doc = "Altitude uncertainty."]
14616 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14617 pub v_acc: u32,
14618 #[doc = "Speed uncertainty."]
14619 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14620 pub vel_acc: u32,
14621 #[doc = "Heading / track uncertainty"]
14622 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14623 pub hdg_acc: u32,
14624}
14625impl GPS2_RAW_DATA {
14626 pub const ENCODED_LEN: usize = 57usize;
14627 pub const DEFAULT: Self = Self {
14628 time_usec: 0_u64,
14629 lat: 0_i32,
14630 lon: 0_i32,
14631 alt: 0_i32,
14632 dgps_age: 0_u32,
14633 eph: 0_u16,
14634 epv: 0_u16,
14635 vel: 0_u16,
14636 cog: 0_u16,
14637 fix_type: GpsFixType::DEFAULT,
14638 satellites_visible: 0_u8,
14639 dgps_numch: 0_u8,
14640 yaw: 0_u16,
14641 alt_ellipsoid: 0_i32,
14642 h_acc: 0_u32,
14643 v_acc: 0_u32,
14644 vel_acc: 0_u32,
14645 hdg_acc: 0_u32,
14646 };
14647 #[cfg(feature = "arbitrary")]
14648 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14649 use arbitrary::{Arbitrary, Unstructured};
14650 let mut buf = [0u8; 1024];
14651 rng.fill_bytes(&mut buf);
14652 let mut unstructured = Unstructured::new(&buf);
14653 Self::arbitrary(&mut unstructured).unwrap_or_default()
14654 }
14655}
14656impl Default for GPS2_RAW_DATA {
14657 fn default() -> Self {
14658 Self::DEFAULT.clone()
14659 }
14660}
14661impl MessageData for GPS2_RAW_DATA {
14662 type Message = MavMessage;
14663 const ID: u32 = 124u32;
14664 const NAME: &'static str = "GPS2_RAW";
14665 const EXTRA_CRC: u8 = 87u8;
14666 const ENCODED_LEN: usize = 57usize;
14667 fn deser(
14668 _version: MavlinkVersion,
14669 __input: &[u8],
14670 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14671 let avail_len = __input.len();
14672 let mut payload_buf = [0; Self::ENCODED_LEN];
14673 let mut buf = if avail_len < Self::ENCODED_LEN {
14674 payload_buf[0..avail_len].copy_from_slice(__input);
14675 Bytes::new(&payload_buf)
14676 } else {
14677 Bytes::new(__input)
14678 };
14679 let mut __struct = Self::default();
14680 __struct.time_usec = buf.get_u64_le()?;
14681 __struct.lat = buf.get_i32_le()?;
14682 __struct.lon = buf.get_i32_le()?;
14683 __struct.alt = buf.get_i32_le()?;
14684 __struct.dgps_age = buf.get_u32_le()?;
14685 __struct.eph = buf.get_u16_le()?;
14686 __struct.epv = buf.get_u16_le()?;
14687 __struct.vel = buf.get_u16_le()?;
14688 __struct.cog = buf.get_u16_le()?;
14689 let tmp = buf.get_u8()?;
14690 __struct.fix_type =
14691 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14692 enum_type: "GpsFixType",
14693 value: tmp as u64,
14694 })?;
14695 __struct.satellites_visible = buf.get_u8()?;
14696 __struct.dgps_numch = buf.get_u8()?;
14697 __struct.yaw = buf.get_u16_le()?;
14698 __struct.alt_ellipsoid = buf.get_i32_le()?;
14699 __struct.h_acc = buf.get_u32_le()?;
14700 __struct.v_acc = buf.get_u32_le()?;
14701 __struct.vel_acc = buf.get_u32_le()?;
14702 __struct.hdg_acc = buf.get_u32_le()?;
14703 Ok(__struct)
14704 }
14705 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14706 let mut __tmp = BytesMut::new(bytes);
14707 #[allow(clippy::absurd_extreme_comparisons)]
14708 #[allow(unused_comparisons)]
14709 if __tmp.remaining() < Self::ENCODED_LEN {
14710 panic!(
14711 "buffer is too small (need {} bytes, but got {})",
14712 Self::ENCODED_LEN,
14713 __tmp.remaining(),
14714 )
14715 }
14716 __tmp.put_u64_le(self.time_usec);
14717 __tmp.put_i32_le(self.lat);
14718 __tmp.put_i32_le(self.lon);
14719 __tmp.put_i32_le(self.alt);
14720 __tmp.put_u32_le(self.dgps_age);
14721 __tmp.put_u16_le(self.eph);
14722 __tmp.put_u16_le(self.epv);
14723 __tmp.put_u16_le(self.vel);
14724 __tmp.put_u16_le(self.cog);
14725 __tmp.put_u8(self.fix_type as u8);
14726 __tmp.put_u8(self.satellites_visible);
14727 __tmp.put_u8(self.dgps_numch);
14728 if matches!(version, MavlinkVersion::V2) {
14729 __tmp.put_u16_le(self.yaw);
14730 __tmp.put_i32_le(self.alt_ellipsoid);
14731 __tmp.put_u32_le(self.h_acc);
14732 __tmp.put_u32_le(self.v_acc);
14733 __tmp.put_u32_le(self.vel_acc);
14734 __tmp.put_u32_le(self.hdg_acc);
14735 let len = __tmp.len();
14736 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14737 } else {
14738 __tmp.len()
14739 }
14740 }
14741}
14742#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14743#[doc = ""]
14744#[doc = "ID: 128"]
14745#[derive(Debug, Clone, PartialEq)]
14746#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14747#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14748#[cfg_attr(feature = "ts", derive(TS))]
14749#[cfg_attr(feature = "ts", ts(export))]
14750pub struct GPS2_RTK_DATA {
14751 #[doc = "Time since boot of last baseline message received."]
14752 pub time_last_baseline_ms: u32,
14753 #[doc = "GPS Time of Week of last baseline"]
14754 pub tow: u32,
14755 #[doc = "Current baseline in ECEF x or NED north component."]
14756 pub baseline_a_mm: i32,
14757 #[doc = "Current baseline in ECEF y or NED east component."]
14758 pub baseline_b_mm: i32,
14759 #[doc = "Current baseline in ECEF z or NED down component."]
14760 pub baseline_c_mm: i32,
14761 #[doc = "Current estimate of baseline accuracy."]
14762 pub accuracy: u32,
14763 #[doc = "Current number of integer ambiguity hypotheses."]
14764 pub iar_num_hypotheses: i32,
14765 #[doc = "GPS Week Number of last baseline"]
14766 pub wn: u16,
14767 #[doc = "Identification of connected RTK receiver."]
14768 pub rtk_receiver_id: u8,
14769 #[doc = "GPS-specific health report for RTK data."]
14770 pub rtk_health: u8,
14771 #[doc = "Rate of baseline messages being received by GPS"]
14772 pub rtk_rate: u8,
14773 #[doc = "Current number of sats used for RTK calculation."]
14774 pub nsats: u8,
14775 #[doc = "Coordinate system of baseline"]
14776 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14777}
14778impl GPS2_RTK_DATA {
14779 pub const ENCODED_LEN: usize = 35usize;
14780 pub const DEFAULT: Self = Self {
14781 time_last_baseline_ms: 0_u32,
14782 tow: 0_u32,
14783 baseline_a_mm: 0_i32,
14784 baseline_b_mm: 0_i32,
14785 baseline_c_mm: 0_i32,
14786 accuracy: 0_u32,
14787 iar_num_hypotheses: 0_i32,
14788 wn: 0_u16,
14789 rtk_receiver_id: 0_u8,
14790 rtk_health: 0_u8,
14791 rtk_rate: 0_u8,
14792 nsats: 0_u8,
14793 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14794 };
14795 #[cfg(feature = "arbitrary")]
14796 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14797 use arbitrary::{Arbitrary, Unstructured};
14798 let mut buf = [0u8; 1024];
14799 rng.fill_bytes(&mut buf);
14800 let mut unstructured = Unstructured::new(&buf);
14801 Self::arbitrary(&mut unstructured).unwrap_or_default()
14802 }
14803}
14804impl Default for GPS2_RTK_DATA {
14805 fn default() -> Self {
14806 Self::DEFAULT.clone()
14807 }
14808}
14809impl MessageData for GPS2_RTK_DATA {
14810 type Message = MavMessage;
14811 const ID: u32 = 128u32;
14812 const NAME: &'static str = "GPS2_RTK";
14813 const EXTRA_CRC: u8 = 226u8;
14814 const ENCODED_LEN: usize = 35usize;
14815 fn deser(
14816 _version: MavlinkVersion,
14817 __input: &[u8],
14818 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14819 let avail_len = __input.len();
14820 let mut payload_buf = [0; Self::ENCODED_LEN];
14821 let mut buf = if avail_len < Self::ENCODED_LEN {
14822 payload_buf[0..avail_len].copy_from_slice(__input);
14823 Bytes::new(&payload_buf)
14824 } else {
14825 Bytes::new(__input)
14826 };
14827 let mut __struct = Self::default();
14828 __struct.time_last_baseline_ms = buf.get_u32_le()?;
14829 __struct.tow = buf.get_u32_le()?;
14830 __struct.baseline_a_mm = buf.get_i32_le()?;
14831 __struct.baseline_b_mm = buf.get_i32_le()?;
14832 __struct.baseline_c_mm = buf.get_i32_le()?;
14833 __struct.accuracy = buf.get_u32_le()?;
14834 __struct.iar_num_hypotheses = buf.get_i32_le()?;
14835 __struct.wn = buf.get_u16_le()?;
14836 __struct.rtk_receiver_id = buf.get_u8()?;
14837 __struct.rtk_health = buf.get_u8()?;
14838 __struct.rtk_rate = buf.get_u8()?;
14839 __struct.nsats = buf.get_u8()?;
14840 let tmp = buf.get_u8()?;
14841 __struct.baseline_coords_type =
14842 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14843 enum_type: "RtkBaselineCoordinateSystem",
14844 value: tmp as u64,
14845 })?;
14846 Ok(__struct)
14847 }
14848 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14849 let mut __tmp = BytesMut::new(bytes);
14850 #[allow(clippy::absurd_extreme_comparisons)]
14851 #[allow(unused_comparisons)]
14852 if __tmp.remaining() < Self::ENCODED_LEN {
14853 panic!(
14854 "buffer is too small (need {} bytes, but got {})",
14855 Self::ENCODED_LEN,
14856 __tmp.remaining(),
14857 )
14858 }
14859 __tmp.put_u32_le(self.time_last_baseline_ms);
14860 __tmp.put_u32_le(self.tow);
14861 __tmp.put_i32_le(self.baseline_a_mm);
14862 __tmp.put_i32_le(self.baseline_b_mm);
14863 __tmp.put_i32_le(self.baseline_c_mm);
14864 __tmp.put_u32_le(self.accuracy);
14865 __tmp.put_i32_le(self.iar_num_hypotheses);
14866 __tmp.put_u16_le(self.wn);
14867 __tmp.put_u8(self.rtk_receiver_id);
14868 __tmp.put_u8(self.rtk_health);
14869 __tmp.put_u8(self.rtk_rate);
14870 __tmp.put_u8(self.nsats);
14871 __tmp.put_u8(self.baseline_coords_type as u8);
14872 if matches!(version, MavlinkVersion::V2) {
14873 let len = __tmp.len();
14874 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14875 } else {
14876 __tmp.len()
14877 }
14878 }
14879}
14880#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
14881#[doc = ""]
14882#[doc = "ID: 49"]
14883#[derive(Debug, Clone, PartialEq)]
14884#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14885#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14886#[cfg_attr(feature = "ts", derive(TS))]
14887#[cfg_attr(feature = "ts", ts(export))]
14888pub struct GPS_GLOBAL_ORIGIN_DATA {
14889 #[doc = "Latitude (WGS84)"]
14890 pub latitude: i32,
14891 #[doc = "Longitude (WGS84)"]
14892 pub longitude: i32,
14893 #[doc = "Altitude (MSL). Positive for up."]
14894 pub altitude: i32,
14895 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14896 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14897 pub time_usec: u64,
14898}
14899impl GPS_GLOBAL_ORIGIN_DATA {
14900 pub const ENCODED_LEN: usize = 20usize;
14901 pub const DEFAULT: Self = Self {
14902 latitude: 0_i32,
14903 longitude: 0_i32,
14904 altitude: 0_i32,
14905 time_usec: 0_u64,
14906 };
14907 #[cfg(feature = "arbitrary")]
14908 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14909 use arbitrary::{Arbitrary, Unstructured};
14910 let mut buf = [0u8; 1024];
14911 rng.fill_bytes(&mut buf);
14912 let mut unstructured = Unstructured::new(&buf);
14913 Self::arbitrary(&mut unstructured).unwrap_or_default()
14914 }
14915}
14916impl Default for GPS_GLOBAL_ORIGIN_DATA {
14917 fn default() -> Self {
14918 Self::DEFAULT.clone()
14919 }
14920}
14921impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
14922 type Message = MavMessage;
14923 const ID: u32 = 49u32;
14924 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
14925 const EXTRA_CRC: u8 = 39u8;
14926 const ENCODED_LEN: usize = 20usize;
14927 fn deser(
14928 _version: MavlinkVersion,
14929 __input: &[u8],
14930 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14931 let avail_len = __input.len();
14932 let mut payload_buf = [0; Self::ENCODED_LEN];
14933 let mut buf = if avail_len < Self::ENCODED_LEN {
14934 payload_buf[0..avail_len].copy_from_slice(__input);
14935 Bytes::new(&payload_buf)
14936 } else {
14937 Bytes::new(__input)
14938 };
14939 let mut __struct = Self::default();
14940 __struct.latitude = buf.get_i32_le()?;
14941 __struct.longitude = buf.get_i32_le()?;
14942 __struct.altitude = buf.get_i32_le()?;
14943 __struct.time_usec = buf.get_u64_le()?;
14944 Ok(__struct)
14945 }
14946 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14947 let mut __tmp = BytesMut::new(bytes);
14948 #[allow(clippy::absurd_extreme_comparisons)]
14949 #[allow(unused_comparisons)]
14950 if __tmp.remaining() < Self::ENCODED_LEN {
14951 panic!(
14952 "buffer is too small (need {} bytes, but got {})",
14953 Self::ENCODED_LEN,
14954 __tmp.remaining(),
14955 )
14956 }
14957 __tmp.put_i32_le(self.latitude);
14958 __tmp.put_i32_le(self.longitude);
14959 __tmp.put_i32_le(self.altitude);
14960 if matches!(version, MavlinkVersion::V2) {
14961 __tmp.put_u64_le(self.time_usec);
14962 let len = __tmp.len();
14963 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14964 } else {
14965 __tmp.len()
14966 }
14967 }
14968}
14969#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
14970#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
14971#[doc = ""]
14972#[doc = "ID: 123"]
14973#[derive(Debug, Clone, PartialEq)]
14974#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14975#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14976#[cfg_attr(feature = "ts", derive(TS))]
14977#[cfg_attr(feature = "ts", ts(export))]
14978pub struct GPS_INJECT_DATA_DATA {
14979 #[doc = "System ID"]
14980 pub target_system: u8,
14981 #[doc = "Component ID"]
14982 pub target_component: u8,
14983 #[doc = "Data length"]
14984 pub len: u8,
14985 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
14986 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14987 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14988 pub data: [u8; 110],
14989}
14990impl GPS_INJECT_DATA_DATA {
14991 pub const ENCODED_LEN: usize = 113usize;
14992 pub const DEFAULT: Self = Self {
14993 target_system: 0_u8,
14994 target_component: 0_u8,
14995 len: 0_u8,
14996 data: [0_u8; 110usize],
14997 };
14998 #[cfg(feature = "arbitrary")]
14999 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15000 use arbitrary::{Arbitrary, Unstructured};
15001 let mut buf = [0u8; 1024];
15002 rng.fill_bytes(&mut buf);
15003 let mut unstructured = Unstructured::new(&buf);
15004 Self::arbitrary(&mut unstructured).unwrap_or_default()
15005 }
15006}
15007impl Default for GPS_INJECT_DATA_DATA {
15008 fn default() -> Self {
15009 Self::DEFAULT.clone()
15010 }
15011}
15012impl MessageData for GPS_INJECT_DATA_DATA {
15013 type Message = MavMessage;
15014 const ID: u32 = 123u32;
15015 const NAME: &'static str = "GPS_INJECT_DATA";
15016 const EXTRA_CRC: u8 = 250u8;
15017 const ENCODED_LEN: usize = 113usize;
15018 fn deser(
15019 _version: MavlinkVersion,
15020 __input: &[u8],
15021 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15022 let avail_len = __input.len();
15023 let mut payload_buf = [0; Self::ENCODED_LEN];
15024 let mut buf = if avail_len < Self::ENCODED_LEN {
15025 payload_buf[0..avail_len].copy_from_slice(__input);
15026 Bytes::new(&payload_buf)
15027 } else {
15028 Bytes::new(__input)
15029 };
15030 let mut __struct = Self::default();
15031 __struct.target_system = buf.get_u8()?;
15032 __struct.target_component = buf.get_u8()?;
15033 __struct.len = buf.get_u8()?;
15034 for v in &mut __struct.data {
15035 let val = buf.get_u8()?;
15036 *v = val;
15037 }
15038 Ok(__struct)
15039 }
15040 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15041 let mut __tmp = BytesMut::new(bytes);
15042 #[allow(clippy::absurd_extreme_comparisons)]
15043 #[allow(unused_comparisons)]
15044 if __tmp.remaining() < Self::ENCODED_LEN {
15045 panic!(
15046 "buffer is too small (need {} bytes, but got {})",
15047 Self::ENCODED_LEN,
15048 __tmp.remaining(),
15049 )
15050 }
15051 __tmp.put_u8(self.target_system);
15052 __tmp.put_u8(self.target_component);
15053 __tmp.put_u8(self.len);
15054 for val in &self.data {
15055 __tmp.put_u8(*val);
15056 }
15057 if matches!(version, MavlinkVersion::V2) {
15058 let len = __tmp.len();
15059 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15060 } else {
15061 __tmp.len()
15062 }
15063 }
15064}
15065#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
15066#[doc = ""]
15067#[doc = "ID: 232"]
15068#[derive(Debug, Clone, PartialEq)]
15069#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15070#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15071#[cfg_attr(feature = "ts", derive(TS))]
15072#[cfg_attr(feature = "ts", ts(export))]
15073pub struct GPS_INPUT_DATA {
15074 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15075 pub time_usec: u64,
15076 #[doc = "GPS time (from start of GPS week)"]
15077 pub time_week_ms: u32,
15078 #[doc = "Latitude (WGS84)"]
15079 pub lat: i32,
15080 #[doc = "Longitude (WGS84)"]
15081 pub lon: i32,
15082 #[doc = "Altitude (MSL). Positive for up."]
15083 pub alt: f32,
15084 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
15085 pub hdop: f32,
15086 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
15087 pub vdop: f32,
15088 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
15089 pub vn: f32,
15090 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
15091 pub ve: f32,
15092 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
15093 pub vd: f32,
15094 #[doc = "GPS speed accuracy"]
15095 pub speed_accuracy: f32,
15096 #[doc = "GPS horizontal accuracy"]
15097 pub horiz_accuracy: f32,
15098 #[doc = "GPS vertical accuracy"]
15099 pub vert_accuracy: f32,
15100 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
15101 pub ignore_flags: GpsInputIgnoreFlags,
15102 #[doc = "GPS week number"]
15103 pub time_week: u16,
15104 #[doc = "ID of the GPS for multiple GPS inputs"]
15105 pub gps_id: u8,
15106 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
15107 pub fix_type: u8,
15108 #[doc = "Number of satellites visible."]
15109 pub satellites_visible: u8,
15110 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
15111 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15112 pub yaw: u16,
15113}
15114impl GPS_INPUT_DATA {
15115 pub const ENCODED_LEN: usize = 65usize;
15116 pub const DEFAULT: Self = Self {
15117 time_usec: 0_u64,
15118 time_week_ms: 0_u32,
15119 lat: 0_i32,
15120 lon: 0_i32,
15121 alt: 0.0_f32,
15122 hdop: 0.0_f32,
15123 vdop: 0.0_f32,
15124 vn: 0.0_f32,
15125 ve: 0.0_f32,
15126 vd: 0.0_f32,
15127 speed_accuracy: 0.0_f32,
15128 horiz_accuracy: 0.0_f32,
15129 vert_accuracy: 0.0_f32,
15130 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
15131 time_week: 0_u16,
15132 gps_id: 0_u8,
15133 fix_type: 0_u8,
15134 satellites_visible: 0_u8,
15135 yaw: 0_u16,
15136 };
15137 #[cfg(feature = "arbitrary")]
15138 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15139 use arbitrary::{Arbitrary, Unstructured};
15140 let mut buf = [0u8; 1024];
15141 rng.fill_bytes(&mut buf);
15142 let mut unstructured = Unstructured::new(&buf);
15143 Self::arbitrary(&mut unstructured).unwrap_or_default()
15144 }
15145}
15146impl Default for GPS_INPUT_DATA {
15147 fn default() -> Self {
15148 Self::DEFAULT.clone()
15149 }
15150}
15151impl MessageData for GPS_INPUT_DATA {
15152 type Message = MavMessage;
15153 const ID: u32 = 232u32;
15154 const NAME: &'static str = "GPS_INPUT";
15155 const EXTRA_CRC: u8 = 151u8;
15156 const ENCODED_LEN: usize = 65usize;
15157 fn deser(
15158 _version: MavlinkVersion,
15159 __input: &[u8],
15160 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15161 let avail_len = __input.len();
15162 let mut payload_buf = [0; Self::ENCODED_LEN];
15163 let mut buf = if avail_len < Self::ENCODED_LEN {
15164 payload_buf[0..avail_len].copy_from_slice(__input);
15165 Bytes::new(&payload_buf)
15166 } else {
15167 Bytes::new(__input)
15168 };
15169 let mut __struct = Self::default();
15170 __struct.time_usec = buf.get_u64_le()?;
15171 __struct.time_week_ms = buf.get_u32_le()?;
15172 __struct.lat = buf.get_i32_le()?;
15173 __struct.lon = buf.get_i32_le()?;
15174 __struct.alt = buf.get_f32_le()?;
15175 __struct.hdop = buf.get_f32_le()?;
15176 __struct.vdop = buf.get_f32_le()?;
15177 __struct.vn = buf.get_f32_le()?;
15178 __struct.ve = buf.get_f32_le()?;
15179 __struct.vd = buf.get_f32_le()?;
15180 __struct.speed_accuracy = buf.get_f32_le()?;
15181 __struct.horiz_accuracy = buf.get_f32_le()?;
15182 __struct.vert_accuracy = buf.get_f32_le()?;
15183 let tmp = buf.get_u16_le()?;
15184 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
15185 tmp as <GpsInputIgnoreFlags as Flags>::Bits,
15186 )
15187 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15188 flag_type: "GpsInputIgnoreFlags",
15189 value: tmp as u64,
15190 })?;
15191 __struct.time_week = buf.get_u16_le()?;
15192 __struct.gps_id = buf.get_u8()?;
15193 __struct.fix_type = buf.get_u8()?;
15194 __struct.satellites_visible = buf.get_u8()?;
15195 __struct.yaw = buf.get_u16_le()?;
15196 Ok(__struct)
15197 }
15198 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15199 let mut __tmp = BytesMut::new(bytes);
15200 #[allow(clippy::absurd_extreme_comparisons)]
15201 #[allow(unused_comparisons)]
15202 if __tmp.remaining() < Self::ENCODED_LEN {
15203 panic!(
15204 "buffer is too small (need {} bytes, but got {})",
15205 Self::ENCODED_LEN,
15206 __tmp.remaining(),
15207 )
15208 }
15209 __tmp.put_u64_le(self.time_usec);
15210 __tmp.put_u32_le(self.time_week_ms);
15211 __tmp.put_i32_le(self.lat);
15212 __tmp.put_i32_le(self.lon);
15213 __tmp.put_f32_le(self.alt);
15214 __tmp.put_f32_le(self.hdop);
15215 __tmp.put_f32_le(self.vdop);
15216 __tmp.put_f32_le(self.vn);
15217 __tmp.put_f32_le(self.ve);
15218 __tmp.put_f32_le(self.vd);
15219 __tmp.put_f32_le(self.speed_accuracy);
15220 __tmp.put_f32_le(self.horiz_accuracy);
15221 __tmp.put_f32_le(self.vert_accuracy);
15222 __tmp.put_u16_le(self.ignore_flags.bits() as u16);
15223 __tmp.put_u16_le(self.time_week);
15224 __tmp.put_u8(self.gps_id);
15225 __tmp.put_u8(self.fix_type);
15226 __tmp.put_u8(self.satellites_visible);
15227 if matches!(version, MavlinkVersion::V2) {
15228 __tmp.put_u16_le(self.yaw);
15229 let len = __tmp.len();
15230 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15231 } else {
15232 __tmp.len()
15233 }
15234 }
15235}
15236#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
15237#[doc = ""]
15238#[doc = "ID: 24"]
15239#[derive(Debug, Clone, PartialEq)]
15240#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15241#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15242#[cfg_attr(feature = "ts", derive(TS))]
15243#[cfg_attr(feature = "ts", ts(export))]
15244pub struct GPS_RAW_INT_DATA {
15245 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15246 pub time_usec: u64,
15247 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
15248 pub lat: i32,
15249 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
15250 pub lon: i32,
15251 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
15252 pub alt: i32,
15253 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15254 pub eph: u16,
15255 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15256 pub epv: u16,
15257 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
15258 pub vel: u16,
15259 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
15260 pub cog: u16,
15261 #[doc = "GPS fix type."]
15262 pub fix_type: GpsFixType,
15263 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15264 pub satellites_visible: u8,
15265 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
15266 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15267 pub alt_ellipsoid: i32,
15268 #[doc = "Position uncertainty."]
15269 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15270 pub h_acc: u32,
15271 #[doc = "Altitude uncertainty."]
15272 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15273 pub v_acc: u32,
15274 #[doc = "Speed uncertainty."]
15275 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15276 pub vel_acc: u32,
15277 #[doc = "Heading / track uncertainty"]
15278 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15279 pub hdg_acc: u32,
15280 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
15281 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15282 pub yaw: u16,
15283}
15284impl GPS_RAW_INT_DATA {
15285 pub const ENCODED_LEN: usize = 52usize;
15286 pub const DEFAULT: Self = Self {
15287 time_usec: 0_u64,
15288 lat: 0_i32,
15289 lon: 0_i32,
15290 alt: 0_i32,
15291 eph: 0_u16,
15292 epv: 0_u16,
15293 vel: 0_u16,
15294 cog: 0_u16,
15295 fix_type: GpsFixType::DEFAULT,
15296 satellites_visible: 0_u8,
15297 alt_ellipsoid: 0_i32,
15298 h_acc: 0_u32,
15299 v_acc: 0_u32,
15300 vel_acc: 0_u32,
15301 hdg_acc: 0_u32,
15302 yaw: 0_u16,
15303 };
15304 #[cfg(feature = "arbitrary")]
15305 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15306 use arbitrary::{Arbitrary, Unstructured};
15307 let mut buf = [0u8; 1024];
15308 rng.fill_bytes(&mut buf);
15309 let mut unstructured = Unstructured::new(&buf);
15310 Self::arbitrary(&mut unstructured).unwrap_or_default()
15311 }
15312}
15313impl Default for GPS_RAW_INT_DATA {
15314 fn default() -> Self {
15315 Self::DEFAULT.clone()
15316 }
15317}
15318impl MessageData for GPS_RAW_INT_DATA {
15319 type Message = MavMessage;
15320 const ID: u32 = 24u32;
15321 const NAME: &'static str = "GPS_RAW_INT";
15322 const EXTRA_CRC: u8 = 24u8;
15323 const ENCODED_LEN: usize = 52usize;
15324 fn deser(
15325 _version: MavlinkVersion,
15326 __input: &[u8],
15327 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15328 let avail_len = __input.len();
15329 let mut payload_buf = [0; Self::ENCODED_LEN];
15330 let mut buf = if avail_len < Self::ENCODED_LEN {
15331 payload_buf[0..avail_len].copy_from_slice(__input);
15332 Bytes::new(&payload_buf)
15333 } else {
15334 Bytes::new(__input)
15335 };
15336 let mut __struct = Self::default();
15337 __struct.time_usec = buf.get_u64_le()?;
15338 __struct.lat = buf.get_i32_le()?;
15339 __struct.lon = buf.get_i32_le()?;
15340 __struct.alt = buf.get_i32_le()?;
15341 __struct.eph = buf.get_u16_le()?;
15342 __struct.epv = buf.get_u16_le()?;
15343 __struct.vel = buf.get_u16_le()?;
15344 __struct.cog = buf.get_u16_le()?;
15345 let tmp = buf.get_u8()?;
15346 __struct.fix_type =
15347 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15348 enum_type: "GpsFixType",
15349 value: tmp as u64,
15350 })?;
15351 __struct.satellites_visible = buf.get_u8()?;
15352 __struct.alt_ellipsoid = buf.get_i32_le()?;
15353 __struct.h_acc = buf.get_u32_le()?;
15354 __struct.v_acc = buf.get_u32_le()?;
15355 __struct.vel_acc = buf.get_u32_le()?;
15356 __struct.hdg_acc = buf.get_u32_le()?;
15357 __struct.yaw = buf.get_u16_le()?;
15358 Ok(__struct)
15359 }
15360 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15361 let mut __tmp = BytesMut::new(bytes);
15362 #[allow(clippy::absurd_extreme_comparisons)]
15363 #[allow(unused_comparisons)]
15364 if __tmp.remaining() < Self::ENCODED_LEN {
15365 panic!(
15366 "buffer is too small (need {} bytes, but got {})",
15367 Self::ENCODED_LEN,
15368 __tmp.remaining(),
15369 )
15370 }
15371 __tmp.put_u64_le(self.time_usec);
15372 __tmp.put_i32_le(self.lat);
15373 __tmp.put_i32_le(self.lon);
15374 __tmp.put_i32_le(self.alt);
15375 __tmp.put_u16_le(self.eph);
15376 __tmp.put_u16_le(self.epv);
15377 __tmp.put_u16_le(self.vel);
15378 __tmp.put_u16_le(self.cog);
15379 __tmp.put_u8(self.fix_type as u8);
15380 __tmp.put_u8(self.satellites_visible);
15381 if matches!(version, MavlinkVersion::V2) {
15382 __tmp.put_i32_le(self.alt_ellipsoid);
15383 __tmp.put_u32_le(self.h_acc);
15384 __tmp.put_u32_le(self.v_acc);
15385 __tmp.put_u32_le(self.vel_acc);
15386 __tmp.put_u32_le(self.hdg_acc);
15387 __tmp.put_u16_le(self.yaw);
15388 let len = __tmp.len();
15389 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15390 } else {
15391 __tmp.len()
15392 }
15393 }
15394}
15395#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
15396#[doc = ""]
15397#[doc = "ID: 233"]
15398#[derive(Debug, Clone, PartialEq)]
15399#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15400#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15401#[cfg_attr(feature = "ts", derive(TS))]
15402#[cfg_attr(feature = "ts", ts(export))]
15403pub struct GPS_RTCM_DATA_DATA {
15404 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
15405 pub flags: u8,
15406 #[doc = "data length"]
15407 pub len: u8,
15408 #[doc = "RTCM message (may be fragmented)"]
15409 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15410 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15411 pub data: [u8; 180],
15412}
15413impl GPS_RTCM_DATA_DATA {
15414 pub const ENCODED_LEN: usize = 182usize;
15415 pub const DEFAULT: Self = Self {
15416 flags: 0_u8,
15417 len: 0_u8,
15418 data: [0_u8; 180usize],
15419 };
15420 #[cfg(feature = "arbitrary")]
15421 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15422 use arbitrary::{Arbitrary, Unstructured};
15423 let mut buf = [0u8; 1024];
15424 rng.fill_bytes(&mut buf);
15425 let mut unstructured = Unstructured::new(&buf);
15426 Self::arbitrary(&mut unstructured).unwrap_or_default()
15427 }
15428}
15429impl Default for GPS_RTCM_DATA_DATA {
15430 fn default() -> Self {
15431 Self::DEFAULT.clone()
15432 }
15433}
15434impl MessageData for GPS_RTCM_DATA_DATA {
15435 type Message = MavMessage;
15436 const ID: u32 = 233u32;
15437 const NAME: &'static str = "GPS_RTCM_DATA";
15438 const EXTRA_CRC: u8 = 35u8;
15439 const ENCODED_LEN: usize = 182usize;
15440 fn deser(
15441 _version: MavlinkVersion,
15442 __input: &[u8],
15443 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15444 let avail_len = __input.len();
15445 let mut payload_buf = [0; Self::ENCODED_LEN];
15446 let mut buf = if avail_len < Self::ENCODED_LEN {
15447 payload_buf[0..avail_len].copy_from_slice(__input);
15448 Bytes::new(&payload_buf)
15449 } else {
15450 Bytes::new(__input)
15451 };
15452 let mut __struct = Self::default();
15453 __struct.flags = buf.get_u8()?;
15454 __struct.len = buf.get_u8()?;
15455 for v in &mut __struct.data {
15456 let val = buf.get_u8()?;
15457 *v = val;
15458 }
15459 Ok(__struct)
15460 }
15461 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15462 let mut __tmp = BytesMut::new(bytes);
15463 #[allow(clippy::absurd_extreme_comparisons)]
15464 #[allow(unused_comparisons)]
15465 if __tmp.remaining() < Self::ENCODED_LEN {
15466 panic!(
15467 "buffer is too small (need {} bytes, but got {})",
15468 Self::ENCODED_LEN,
15469 __tmp.remaining(),
15470 )
15471 }
15472 __tmp.put_u8(self.flags);
15473 __tmp.put_u8(self.len);
15474 for val in &self.data {
15475 __tmp.put_u8(*val);
15476 }
15477 if matches!(version, MavlinkVersion::V2) {
15478 let len = __tmp.len();
15479 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15480 } else {
15481 __tmp.len()
15482 }
15483 }
15484}
15485#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
15486#[doc = ""]
15487#[doc = "ID: 127"]
15488#[derive(Debug, Clone, PartialEq)]
15489#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15490#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15491#[cfg_attr(feature = "ts", derive(TS))]
15492#[cfg_attr(feature = "ts", ts(export))]
15493pub struct GPS_RTK_DATA {
15494 #[doc = "Time since boot of last baseline message received."]
15495 pub time_last_baseline_ms: u32,
15496 #[doc = "GPS Time of Week of last baseline"]
15497 pub tow: u32,
15498 #[doc = "Current baseline in ECEF x or NED north component."]
15499 pub baseline_a_mm: i32,
15500 #[doc = "Current baseline in ECEF y or NED east component."]
15501 pub baseline_b_mm: i32,
15502 #[doc = "Current baseline in ECEF z or NED down component."]
15503 pub baseline_c_mm: i32,
15504 #[doc = "Current estimate of baseline accuracy."]
15505 pub accuracy: u32,
15506 #[doc = "Current number of integer ambiguity hypotheses."]
15507 pub iar_num_hypotheses: i32,
15508 #[doc = "GPS Week Number of last baseline"]
15509 pub wn: u16,
15510 #[doc = "Identification of connected RTK receiver."]
15511 pub rtk_receiver_id: u8,
15512 #[doc = "GPS-specific health report for RTK data."]
15513 pub rtk_health: u8,
15514 #[doc = "Rate of baseline messages being received by GPS"]
15515 pub rtk_rate: u8,
15516 #[doc = "Current number of sats used for RTK calculation."]
15517 pub nsats: u8,
15518 #[doc = "Coordinate system of baseline"]
15519 pub baseline_coords_type: RtkBaselineCoordinateSystem,
15520}
15521impl GPS_RTK_DATA {
15522 pub const ENCODED_LEN: usize = 35usize;
15523 pub const DEFAULT: Self = Self {
15524 time_last_baseline_ms: 0_u32,
15525 tow: 0_u32,
15526 baseline_a_mm: 0_i32,
15527 baseline_b_mm: 0_i32,
15528 baseline_c_mm: 0_i32,
15529 accuracy: 0_u32,
15530 iar_num_hypotheses: 0_i32,
15531 wn: 0_u16,
15532 rtk_receiver_id: 0_u8,
15533 rtk_health: 0_u8,
15534 rtk_rate: 0_u8,
15535 nsats: 0_u8,
15536 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
15537 };
15538 #[cfg(feature = "arbitrary")]
15539 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15540 use arbitrary::{Arbitrary, Unstructured};
15541 let mut buf = [0u8; 1024];
15542 rng.fill_bytes(&mut buf);
15543 let mut unstructured = Unstructured::new(&buf);
15544 Self::arbitrary(&mut unstructured).unwrap_or_default()
15545 }
15546}
15547impl Default for GPS_RTK_DATA {
15548 fn default() -> Self {
15549 Self::DEFAULT.clone()
15550 }
15551}
15552impl MessageData for GPS_RTK_DATA {
15553 type Message = MavMessage;
15554 const ID: u32 = 127u32;
15555 const NAME: &'static str = "GPS_RTK";
15556 const EXTRA_CRC: u8 = 25u8;
15557 const ENCODED_LEN: usize = 35usize;
15558 fn deser(
15559 _version: MavlinkVersion,
15560 __input: &[u8],
15561 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15562 let avail_len = __input.len();
15563 let mut payload_buf = [0; Self::ENCODED_LEN];
15564 let mut buf = if avail_len < Self::ENCODED_LEN {
15565 payload_buf[0..avail_len].copy_from_slice(__input);
15566 Bytes::new(&payload_buf)
15567 } else {
15568 Bytes::new(__input)
15569 };
15570 let mut __struct = Self::default();
15571 __struct.time_last_baseline_ms = buf.get_u32_le()?;
15572 __struct.tow = buf.get_u32_le()?;
15573 __struct.baseline_a_mm = buf.get_i32_le()?;
15574 __struct.baseline_b_mm = buf.get_i32_le()?;
15575 __struct.baseline_c_mm = buf.get_i32_le()?;
15576 __struct.accuracy = buf.get_u32_le()?;
15577 __struct.iar_num_hypotheses = buf.get_i32_le()?;
15578 __struct.wn = buf.get_u16_le()?;
15579 __struct.rtk_receiver_id = buf.get_u8()?;
15580 __struct.rtk_health = buf.get_u8()?;
15581 __struct.rtk_rate = buf.get_u8()?;
15582 __struct.nsats = buf.get_u8()?;
15583 let tmp = buf.get_u8()?;
15584 __struct.baseline_coords_type =
15585 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15586 enum_type: "RtkBaselineCoordinateSystem",
15587 value: tmp as u64,
15588 })?;
15589 Ok(__struct)
15590 }
15591 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15592 let mut __tmp = BytesMut::new(bytes);
15593 #[allow(clippy::absurd_extreme_comparisons)]
15594 #[allow(unused_comparisons)]
15595 if __tmp.remaining() < Self::ENCODED_LEN {
15596 panic!(
15597 "buffer is too small (need {} bytes, but got {})",
15598 Self::ENCODED_LEN,
15599 __tmp.remaining(),
15600 )
15601 }
15602 __tmp.put_u32_le(self.time_last_baseline_ms);
15603 __tmp.put_u32_le(self.tow);
15604 __tmp.put_i32_le(self.baseline_a_mm);
15605 __tmp.put_i32_le(self.baseline_b_mm);
15606 __tmp.put_i32_le(self.baseline_c_mm);
15607 __tmp.put_u32_le(self.accuracy);
15608 __tmp.put_i32_le(self.iar_num_hypotheses);
15609 __tmp.put_u16_le(self.wn);
15610 __tmp.put_u8(self.rtk_receiver_id);
15611 __tmp.put_u8(self.rtk_health);
15612 __tmp.put_u8(self.rtk_rate);
15613 __tmp.put_u8(self.nsats);
15614 __tmp.put_u8(self.baseline_coords_type as u8);
15615 if matches!(version, MavlinkVersion::V2) {
15616 let len = __tmp.len();
15617 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15618 } else {
15619 __tmp.len()
15620 }
15621 }
15622}
15623#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
15624#[doc = ""]
15625#[doc = "ID: 25"]
15626#[derive(Debug, Clone, PartialEq)]
15627#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15628#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15629#[cfg_attr(feature = "ts", derive(TS))]
15630#[cfg_attr(feature = "ts", ts(export))]
15631pub struct GPS_STATUS_DATA {
15632 #[doc = "Number of satellites visible"]
15633 pub satellites_visible: u8,
15634 #[doc = "Global satellite ID"]
15635 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15636 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15637 pub satellite_prn: [u8; 20],
15638 #[doc = "0: Satellite not used, 1: used for localization"]
15639 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15640 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15641 pub satellite_used: [u8; 20],
15642 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
15643 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15644 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15645 pub satellite_elevation: [u8; 20],
15646 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
15647 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15648 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15649 pub satellite_azimuth: [u8; 20],
15650 #[doc = "Signal to noise ratio of satellite"]
15651 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15652 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15653 pub satellite_snr: [u8; 20],
15654}
15655impl GPS_STATUS_DATA {
15656 pub const ENCODED_LEN: usize = 101usize;
15657 pub const DEFAULT: Self = Self {
15658 satellites_visible: 0_u8,
15659 satellite_prn: [0_u8; 20usize],
15660 satellite_used: [0_u8; 20usize],
15661 satellite_elevation: [0_u8; 20usize],
15662 satellite_azimuth: [0_u8; 20usize],
15663 satellite_snr: [0_u8; 20usize],
15664 };
15665 #[cfg(feature = "arbitrary")]
15666 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15667 use arbitrary::{Arbitrary, Unstructured};
15668 let mut buf = [0u8; 1024];
15669 rng.fill_bytes(&mut buf);
15670 let mut unstructured = Unstructured::new(&buf);
15671 Self::arbitrary(&mut unstructured).unwrap_or_default()
15672 }
15673}
15674impl Default for GPS_STATUS_DATA {
15675 fn default() -> Self {
15676 Self::DEFAULT.clone()
15677 }
15678}
15679impl MessageData for GPS_STATUS_DATA {
15680 type Message = MavMessage;
15681 const ID: u32 = 25u32;
15682 const NAME: &'static str = "GPS_STATUS";
15683 const EXTRA_CRC: u8 = 23u8;
15684 const ENCODED_LEN: usize = 101usize;
15685 fn deser(
15686 _version: MavlinkVersion,
15687 __input: &[u8],
15688 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15689 let avail_len = __input.len();
15690 let mut payload_buf = [0; Self::ENCODED_LEN];
15691 let mut buf = if avail_len < Self::ENCODED_LEN {
15692 payload_buf[0..avail_len].copy_from_slice(__input);
15693 Bytes::new(&payload_buf)
15694 } else {
15695 Bytes::new(__input)
15696 };
15697 let mut __struct = Self::default();
15698 __struct.satellites_visible = buf.get_u8()?;
15699 for v in &mut __struct.satellite_prn {
15700 let val = buf.get_u8()?;
15701 *v = val;
15702 }
15703 for v in &mut __struct.satellite_used {
15704 let val = buf.get_u8()?;
15705 *v = val;
15706 }
15707 for v in &mut __struct.satellite_elevation {
15708 let val = buf.get_u8()?;
15709 *v = val;
15710 }
15711 for v in &mut __struct.satellite_azimuth {
15712 let val = buf.get_u8()?;
15713 *v = val;
15714 }
15715 for v in &mut __struct.satellite_snr {
15716 let val = buf.get_u8()?;
15717 *v = val;
15718 }
15719 Ok(__struct)
15720 }
15721 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15722 let mut __tmp = BytesMut::new(bytes);
15723 #[allow(clippy::absurd_extreme_comparisons)]
15724 #[allow(unused_comparisons)]
15725 if __tmp.remaining() < Self::ENCODED_LEN {
15726 panic!(
15727 "buffer is too small (need {} bytes, but got {})",
15728 Self::ENCODED_LEN,
15729 __tmp.remaining(),
15730 )
15731 }
15732 __tmp.put_u8(self.satellites_visible);
15733 for val in &self.satellite_prn {
15734 __tmp.put_u8(*val);
15735 }
15736 for val in &self.satellite_used {
15737 __tmp.put_u8(*val);
15738 }
15739 for val in &self.satellite_elevation {
15740 __tmp.put_u8(*val);
15741 }
15742 for val in &self.satellite_azimuth {
15743 __tmp.put_u8(*val);
15744 }
15745 for val in &self.satellite_snr {
15746 __tmp.put_u8(*val);
15747 }
15748 if matches!(version, MavlinkVersion::V2) {
15749 let len = __tmp.len();
15750 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15751 } else {
15752 __tmp.len()
15753 }
15754 }
15755}
15756#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
15757#[doc = ""]
15758#[doc = "ID: 0"]
15759#[derive(Debug, Clone, PartialEq)]
15760#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15761#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15762#[cfg_attr(feature = "ts", derive(TS))]
15763#[cfg_attr(feature = "ts", ts(export))]
15764pub struct HEARTBEAT_DATA {
15765 #[doc = "A bitfield for use for autopilot-specific flags"]
15766 pub custom_mode: u32,
15767 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
15768 pub mavtype: MavType,
15769 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15770 pub autopilot: MavAutopilot,
15771 #[doc = "System mode bitmap."]
15772 pub base_mode: MavModeFlag,
15773 #[doc = "System status flag."]
15774 pub system_status: MavState,
15775 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
15776 pub mavlink_version: u8,
15777}
15778impl HEARTBEAT_DATA {
15779 pub const ENCODED_LEN: usize = 9usize;
15780 pub const DEFAULT: Self = Self {
15781 custom_mode: 0_u32,
15782 mavtype: MavType::DEFAULT,
15783 autopilot: MavAutopilot::DEFAULT,
15784 base_mode: MavModeFlag::DEFAULT,
15785 system_status: MavState::DEFAULT,
15786 mavlink_version: MINOR_MAVLINK_VERSION,
15787 };
15788 #[cfg(feature = "arbitrary")]
15789 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15790 use arbitrary::{Arbitrary, Unstructured};
15791 let mut buf = [0u8; 1024];
15792 rng.fill_bytes(&mut buf);
15793 let mut unstructured = Unstructured::new(&buf);
15794 Self::arbitrary(&mut unstructured).unwrap_or_default()
15795 }
15796}
15797impl Default for HEARTBEAT_DATA {
15798 fn default() -> Self {
15799 Self::DEFAULT.clone()
15800 }
15801}
15802impl MessageData for HEARTBEAT_DATA {
15803 type Message = MavMessage;
15804 const ID: u32 = 0u32;
15805 const NAME: &'static str = "HEARTBEAT";
15806 const EXTRA_CRC: u8 = 50u8;
15807 const ENCODED_LEN: usize = 9usize;
15808 fn deser(
15809 _version: MavlinkVersion,
15810 __input: &[u8],
15811 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15812 let avail_len = __input.len();
15813 let mut payload_buf = [0; Self::ENCODED_LEN];
15814 let mut buf = if avail_len < Self::ENCODED_LEN {
15815 payload_buf[0..avail_len].copy_from_slice(__input);
15816 Bytes::new(&payload_buf)
15817 } else {
15818 Bytes::new(__input)
15819 };
15820 let mut __struct = Self::default();
15821 __struct.custom_mode = buf.get_u32_le()?;
15822 let tmp = buf.get_u8()?;
15823 __struct.mavtype =
15824 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15825 enum_type: "MavType",
15826 value: tmp as u64,
15827 })?;
15828 let tmp = buf.get_u8()?;
15829 __struct.autopilot =
15830 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15831 enum_type: "MavAutopilot",
15832 value: tmp as u64,
15833 })?;
15834 let tmp = buf.get_u8()?;
15835 __struct.base_mode = MavModeFlag::from_bits(tmp as <MavModeFlag as Flags>::Bits).ok_or(
15836 ::mavlink_core::error::ParserError::InvalidFlag {
15837 flag_type: "MavModeFlag",
15838 value: tmp as u64,
15839 },
15840 )?;
15841 let tmp = buf.get_u8()?;
15842 __struct.system_status =
15843 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15844 enum_type: "MavState",
15845 value: tmp as u64,
15846 })?;
15847 __struct.mavlink_version = buf.get_u8()?;
15848 Ok(__struct)
15849 }
15850 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15851 let mut __tmp = BytesMut::new(bytes);
15852 #[allow(clippy::absurd_extreme_comparisons)]
15853 #[allow(unused_comparisons)]
15854 if __tmp.remaining() < Self::ENCODED_LEN {
15855 panic!(
15856 "buffer is too small (need {} bytes, but got {})",
15857 Self::ENCODED_LEN,
15858 __tmp.remaining(),
15859 )
15860 }
15861 __tmp.put_u32_le(self.custom_mode);
15862 __tmp.put_u8(self.mavtype as u8);
15863 __tmp.put_u8(self.autopilot as u8);
15864 __tmp.put_u8(self.base_mode.bits() as u8);
15865 __tmp.put_u8(self.system_status as u8);
15866 __tmp.put_u8(self.mavlink_version);
15867 if matches!(version, MavlinkVersion::V2) {
15868 let len = __tmp.len();
15869 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15870 } else {
15871 __tmp.len()
15872 }
15873 }
15874}
15875#[doc = "The IMU readings in SI units in NED body frame."]
15876#[doc = ""]
15877#[doc = "ID: 105"]
15878#[derive(Debug, Clone, PartialEq)]
15879#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15880#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15881#[cfg_attr(feature = "ts", derive(TS))]
15882#[cfg_attr(feature = "ts", ts(export))]
15883pub struct HIGHRES_IMU_DATA {
15884 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15885 pub time_usec: u64,
15886 #[doc = "X acceleration"]
15887 pub xacc: f32,
15888 #[doc = "Y acceleration"]
15889 pub yacc: f32,
15890 #[doc = "Z acceleration"]
15891 pub zacc: f32,
15892 #[doc = "Angular speed around X axis"]
15893 pub xgyro: f32,
15894 #[doc = "Angular speed around Y axis"]
15895 pub ygyro: f32,
15896 #[doc = "Angular speed around Z axis"]
15897 pub zgyro: f32,
15898 #[doc = "X Magnetic field"]
15899 pub xmag: f32,
15900 #[doc = "Y Magnetic field"]
15901 pub ymag: f32,
15902 #[doc = "Z Magnetic field"]
15903 pub zmag: f32,
15904 #[doc = "Absolute pressure"]
15905 pub abs_pressure: f32,
15906 #[doc = "Differential pressure"]
15907 pub diff_pressure: f32,
15908 #[doc = "Altitude calculated from pressure"]
15909 pub pressure_alt: f32,
15910 #[doc = "Temperature"]
15911 pub temperature: f32,
15912 #[doc = "Bitmap for fields that have updated since last message"]
15913 pub fields_updated: HighresImuUpdatedFlags,
15914 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
15915 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15916 pub id: u8,
15917}
15918impl HIGHRES_IMU_DATA {
15919 pub const ENCODED_LEN: usize = 63usize;
15920 pub const DEFAULT: Self = Self {
15921 time_usec: 0_u64,
15922 xacc: 0.0_f32,
15923 yacc: 0.0_f32,
15924 zacc: 0.0_f32,
15925 xgyro: 0.0_f32,
15926 ygyro: 0.0_f32,
15927 zgyro: 0.0_f32,
15928 xmag: 0.0_f32,
15929 ymag: 0.0_f32,
15930 zmag: 0.0_f32,
15931 abs_pressure: 0.0_f32,
15932 diff_pressure: 0.0_f32,
15933 pressure_alt: 0.0_f32,
15934 temperature: 0.0_f32,
15935 fields_updated: HighresImuUpdatedFlags::DEFAULT,
15936 id: 0_u8,
15937 };
15938 #[cfg(feature = "arbitrary")]
15939 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15940 use arbitrary::{Arbitrary, Unstructured};
15941 let mut buf = [0u8; 1024];
15942 rng.fill_bytes(&mut buf);
15943 let mut unstructured = Unstructured::new(&buf);
15944 Self::arbitrary(&mut unstructured).unwrap_or_default()
15945 }
15946}
15947impl Default for HIGHRES_IMU_DATA {
15948 fn default() -> Self {
15949 Self::DEFAULT.clone()
15950 }
15951}
15952impl MessageData for HIGHRES_IMU_DATA {
15953 type Message = MavMessage;
15954 const ID: u32 = 105u32;
15955 const NAME: &'static str = "HIGHRES_IMU";
15956 const EXTRA_CRC: u8 = 93u8;
15957 const ENCODED_LEN: usize = 63usize;
15958 fn deser(
15959 _version: MavlinkVersion,
15960 __input: &[u8],
15961 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15962 let avail_len = __input.len();
15963 let mut payload_buf = [0; Self::ENCODED_LEN];
15964 let mut buf = if avail_len < Self::ENCODED_LEN {
15965 payload_buf[0..avail_len].copy_from_slice(__input);
15966 Bytes::new(&payload_buf)
15967 } else {
15968 Bytes::new(__input)
15969 };
15970 let mut __struct = Self::default();
15971 __struct.time_usec = buf.get_u64_le()?;
15972 __struct.xacc = buf.get_f32_le()?;
15973 __struct.yacc = buf.get_f32_le()?;
15974 __struct.zacc = buf.get_f32_le()?;
15975 __struct.xgyro = buf.get_f32_le()?;
15976 __struct.ygyro = buf.get_f32_le()?;
15977 __struct.zgyro = buf.get_f32_le()?;
15978 __struct.xmag = buf.get_f32_le()?;
15979 __struct.ymag = buf.get_f32_le()?;
15980 __struct.zmag = buf.get_f32_le()?;
15981 __struct.abs_pressure = buf.get_f32_le()?;
15982 __struct.diff_pressure = buf.get_f32_le()?;
15983 __struct.pressure_alt = buf.get_f32_le()?;
15984 __struct.temperature = buf.get_f32_le()?;
15985 let tmp = buf.get_u16_le()?;
15986 __struct.fields_updated =
15987 HighresImuUpdatedFlags::from_bits(tmp as <HighresImuUpdatedFlags as Flags>::Bits)
15988 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15989 flag_type: "HighresImuUpdatedFlags",
15990 value: tmp as u64,
15991 })?;
15992 __struct.id = buf.get_u8()?;
15993 Ok(__struct)
15994 }
15995 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15996 let mut __tmp = BytesMut::new(bytes);
15997 #[allow(clippy::absurd_extreme_comparisons)]
15998 #[allow(unused_comparisons)]
15999 if __tmp.remaining() < Self::ENCODED_LEN {
16000 panic!(
16001 "buffer is too small (need {} bytes, but got {})",
16002 Self::ENCODED_LEN,
16003 __tmp.remaining(),
16004 )
16005 }
16006 __tmp.put_u64_le(self.time_usec);
16007 __tmp.put_f32_le(self.xacc);
16008 __tmp.put_f32_le(self.yacc);
16009 __tmp.put_f32_le(self.zacc);
16010 __tmp.put_f32_le(self.xgyro);
16011 __tmp.put_f32_le(self.ygyro);
16012 __tmp.put_f32_le(self.zgyro);
16013 __tmp.put_f32_le(self.xmag);
16014 __tmp.put_f32_le(self.ymag);
16015 __tmp.put_f32_le(self.zmag);
16016 __tmp.put_f32_le(self.abs_pressure);
16017 __tmp.put_f32_le(self.diff_pressure);
16018 __tmp.put_f32_le(self.pressure_alt);
16019 __tmp.put_f32_le(self.temperature);
16020 __tmp.put_u16_le(self.fields_updated.bits() as u16);
16021 if matches!(version, MavlinkVersion::V2) {
16022 __tmp.put_u8(self.id);
16023 let len = __tmp.len();
16024 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16025 } else {
16026 __tmp.len()
16027 }
16028 }
16029}
16030#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
16031#[doc = "Message appropriate for high latency connections like Iridium."]
16032#[doc = ""]
16033#[doc = "ID: 234"]
16034#[derive(Debug, Clone, PartialEq)]
16035#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16036#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16037#[cfg_attr(feature = "ts", derive(TS))]
16038#[cfg_attr(feature = "ts", ts(export))]
16039pub struct HIGH_LATENCY_DATA {
16040 #[doc = "A bitfield for use for autopilot-specific flags."]
16041 pub custom_mode: u32,
16042 #[doc = "Latitude"]
16043 pub latitude: i32,
16044 #[doc = "Longitude"]
16045 pub longitude: i32,
16046 #[doc = "roll"]
16047 pub roll: i16,
16048 #[doc = "pitch"]
16049 pub pitch: i16,
16050 #[doc = "heading"]
16051 pub heading: u16,
16052 #[doc = "heading setpoint"]
16053 pub heading_sp: i16,
16054 #[doc = "Altitude above mean sea level"]
16055 pub altitude_amsl: i16,
16056 #[doc = "Altitude setpoint relative to the home position"]
16057 pub altitude_sp: i16,
16058 #[doc = "distance to target"]
16059 pub wp_distance: u16,
16060 #[doc = "Bitmap of enabled system modes."]
16061 pub base_mode: MavModeFlag,
16062 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
16063 pub landed_state: MavLandedState,
16064 #[doc = "throttle (percentage)"]
16065 pub throttle: i8,
16066 #[doc = "airspeed"]
16067 pub airspeed: u8,
16068 #[doc = "airspeed setpoint"]
16069 pub airspeed_sp: u8,
16070 #[doc = "groundspeed"]
16071 pub groundspeed: u8,
16072 #[doc = "climb rate"]
16073 pub climb_rate: i8,
16074 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
16075 pub gps_nsat: u8,
16076 #[doc = "GPS Fix type."]
16077 pub gps_fix_type: GpsFixType,
16078 #[doc = "Remaining battery (percentage)"]
16079 pub battery_remaining: u8,
16080 #[doc = "Autopilot temperature (degrees C)"]
16081 pub temperature: i8,
16082 #[doc = "Air temperature (degrees C) from airspeed sensor"]
16083 pub temperature_air: i8,
16084 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
16085 pub failsafe: u8,
16086 #[doc = "current waypoint number"]
16087 pub wp_num: u8,
16088}
16089impl HIGH_LATENCY_DATA {
16090 pub const ENCODED_LEN: usize = 40usize;
16091 pub const DEFAULT: Self = Self {
16092 custom_mode: 0_u32,
16093 latitude: 0_i32,
16094 longitude: 0_i32,
16095 roll: 0_i16,
16096 pitch: 0_i16,
16097 heading: 0_u16,
16098 heading_sp: 0_i16,
16099 altitude_amsl: 0_i16,
16100 altitude_sp: 0_i16,
16101 wp_distance: 0_u16,
16102 base_mode: MavModeFlag::DEFAULT,
16103 landed_state: MavLandedState::DEFAULT,
16104 throttle: 0_i8,
16105 airspeed: 0_u8,
16106 airspeed_sp: 0_u8,
16107 groundspeed: 0_u8,
16108 climb_rate: 0_i8,
16109 gps_nsat: 0_u8,
16110 gps_fix_type: GpsFixType::DEFAULT,
16111 battery_remaining: 0_u8,
16112 temperature: 0_i8,
16113 temperature_air: 0_i8,
16114 failsafe: 0_u8,
16115 wp_num: 0_u8,
16116 };
16117 #[cfg(feature = "arbitrary")]
16118 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16119 use arbitrary::{Arbitrary, Unstructured};
16120 let mut buf = [0u8; 1024];
16121 rng.fill_bytes(&mut buf);
16122 let mut unstructured = Unstructured::new(&buf);
16123 Self::arbitrary(&mut unstructured).unwrap_or_default()
16124 }
16125}
16126impl Default for HIGH_LATENCY_DATA {
16127 fn default() -> Self {
16128 Self::DEFAULT.clone()
16129 }
16130}
16131impl MessageData for HIGH_LATENCY_DATA {
16132 type Message = MavMessage;
16133 const ID: u32 = 234u32;
16134 const NAME: &'static str = "HIGH_LATENCY";
16135 const EXTRA_CRC: u8 = 150u8;
16136 const ENCODED_LEN: usize = 40usize;
16137 fn deser(
16138 _version: MavlinkVersion,
16139 __input: &[u8],
16140 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16141 let avail_len = __input.len();
16142 let mut payload_buf = [0; Self::ENCODED_LEN];
16143 let mut buf = if avail_len < Self::ENCODED_LEN {
16144 payload_buf[0..avail_len].copy_from_slice(__input);
16145 Bytes::new(&payload_buf)
16146 } else {
16147 Bytes::new(__input)
16148 };
16149 let mut __struct = Self::default();
16150 __struct.custom_mode = buf.get_u32_le()?;
16151 __struct.latitude = buf.get_i32_le()?;
16152 __struct.longitude = buf.get_i32_le()?;
16153 __struct.roll = buf.get_i16_le()?;
16154 __struct.pitch = buf.get_i16_le()?;
16155 __struct.heading = buf.get_u16_le()?;
16156 __struct.heading_sp = buf.get_i16_le()?;
16157 __struct.altitude_amsl = buf.get_i16_le()?;
16158 __struct.altitude_sp = buf.get_i16_le()?;
16159 __struct.wp_distance = buf.get_u16_le()?;
16160 let tmp = buf.get_u8()?;
16161 __struct.base_mode = MavModeFlag::from_bits(tmp as <MavModeFlag as Flags>::Bits).ok_or(
16162 ::mavlink_core::error::ParserError::InvalidFlag {
16163 flag_type: "MavModeFlag",
16164 value: tmp as u64,
16165 },
16166 )?;
16167 let tmp = buf.get_u8()?;
16168 __struct.landed_state =
16169 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16170 enum_type: "MavLandedState",
16171 value: tmp as u64,
16172 })?;
16173 __struct.throttle = buf.get_i8()?;
16174 __struct.airspeed = buf.get_u8()?;
16175 __struct.airspeed_sp = buf.get_u8()?;
16176 __struct.groundspeed = buf.get_u8()?;
16177 __struct.climb_rate = buf.get_i8()?;
16178 __struct.gps_nsat = buf.get_u8()?;
16179 let tmp = buf.get_u8()?;
16180 __struct.gps_fix_type =
16181 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16182 enum_type: "GpsFixType",
16183 value: tmp as u64,
16184 })?;
16185 __struct.battery_remaining = buf.get_u8()?;
16186 __struct.temperature = buf.get_i8()?;
16187 __struct.temperature_air = buf.get_i8()?;
16188 __struct.failsafe = buf.get_u8()?;
16189 __struct.wp_num = buf.get_u8()?;
16190 Ok(__struct)
16191 }
16192 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16193 let mut __tmp = BytesMut::new(bytes);
16194 #[allow(clippy::absurd_extreme_comparisons)]
16195 #[allow(unused_comparisons)]
16196 if __tmp.remaining() < Self::ENCODED_LEN {
16197 panic!(
16198 "buffer is too small (need {} bytes, but got {})",
16199 Self::ENCODED_LEN,
16200 __tmp.remaining(),
16201 )
16202 }
16203 __tmp.put_u32_le(self.custom_mode);
16204 __tmp.put_i32_le(self.latitude);
16205 __tmp.put_i32_le(self.longitude);
16206 __tmp.put_i16_le(self.roll);
16207 __tmp.put_i16_le(self.pitch);
16208 __tmp.put_u16_le(self.heading);
16209 __tmp.put_i16_le(self.heading_sp);
16210 __tmp.put_i16_le(self.altitude_amsl);
16211 __tmp.put_i16_le(self.altitude_sp);
16212 __tmp.put_u16_le(self.wp_distance);
16213 __tmp.put_u8(self.base_mode.bits() as u8);
16214 __tmp.put_u8(self.landed_state as u8);
16215 __tmp.put_i8(self.throttle);
16216 __tmp.put_u8(self.airspeed);
16217 __tmp.put_u8(self.airspeed_sp);
16218 __tmp.put_u8(self.groundspeed);
16219 __tmp.put_i8(self.climb_rate);
16220 __tmp.put_u8(self.gps_nsat);
16221 __tmp.put_u8(self.gps_fix_type as u8);
16222 __tmp.put_u8(self.battery_remaining);
16223 __tmp.put_i8(self.temperature);
16224 __tmp.put_i8(self.temperature_air);
16225 __tmp.put_u8(self.failsafe);
16226 __tmp.put_u8(self.wp_num);
16227 if matches!(version, MavlinkVersion::V2) {
16228 let len = __tmp.len();
16229 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16230 } else {
16231 __tmp.len()
16232 }
16233 }
16234}
16235#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
16236#[doc = ""]
16237#[doc = "ID: 235"]
16238#[derive(Debug, Clone, PartialEq)]
16239#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16240#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16241#[cfg_attr(feature = "ts", derive(TS))]
16242#[cfg_attr(feature = "ts", ts(export))]
16243pub struct HIGH_LATENCY2_DATA {
16244 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
16245 pub timestamp: u32,
16246 #[doc = "Latitude"]
16247 pub latitude: i32,
16248 #[doc = "Longitude"]
16249 pub longitude: i32,
16250 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
16251 pub custom_mode: u16,
16252 #[doc = "Altitude above mean sea level"]
16253 pub altitude: i16,
16254 #[doc = "Altitude setpoint"]
16255 pub target_altitude: i16,
16256 #[doc = "Distance to target waypoint or position"]
16257 pub target_distance: u16,
16258 #[doc = "Current waypoint number"]
16259 pub wp_num: u16,
16260 #[doc = "Bitmap of failure flags."]
16261 pub failure_flags: HlFailureFlag,
16262 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
16263 pub mavtype: MavType,
16264 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
16265 pub autopilot: MavAutopilot,
16266 #[doc = "Heading"]
16267 pub heading: u8,
16268 #[doc = "Heading setpoint"]
16269 pub target_heading: u8,
16270 #[doc = "Throttle"]
16271 pub throttle: u8,
16272 #[doc = "Airspeed"]
16273 pub airspeed: u8,
16274 #[doc = "Airspeed setpoint"]
16275 pub airspeed_sp: u8,
16276 #[doc = "Groundspeed"]
16277 pub groundspeed: u8,
16278 #[doc = "Windspeed"]
16279 pub windspeed: u8,
16280 #[doc = "Wind heading"]
16281 pub wind_heading: u8,
16282 #[doc = "Maximum error horizontal position since last message"]
16283 pub eph: u8,
16284 #[doc = "Maximum error vertical position since last message"]
16285 pub epv: u8,
16286 #[doc = "Air temperature"]
16287 pub temperature_air: i8,
16288 #[doc = "Maximum climb rate magnitude since last message"]
16289 pub climb_rate: i8,
16290 #[doc = "Battery level (-1 if field not provided)."]
16291 pub battery: i8,
16292 #[doc = "Field for custom payload."]
16293 pub custom0: i8,
16294 #[doc = "Field for custom payload."]
16295 pub custom1: i8,
16296 #[doc = "Field for custom payload."]
16297 pub custom2: i8,
16298}
16299impl HIGH_LATENCY2_DATA {
16300 pub const ENCODED_LEN: usize = 42usize;
16301 pub const DEFAULT: Self = Self {
16302 timestamp: 0_u32,
16303 latitude: 0_i32,
16304 longitude: 0_i32,
16305 custom_mode: 0_u16,
16306 altitude: 0_i16,
16307 target_altitude: 0_i16,
16308 target_distance: 0_u16,
16309 wp_num: 0_u16,
16310 failure_flags: HlFailureFlag::DEFAULT,
16311 mavtype: MavType::DEFAULT,
16312 autopilot: MavAutopilot::DEFAULT,
16313 heading: 0_u8,
16314 target_heading: 0_u8,
16315 throttle: 0_u8,
16316 airspeed: 0_u8,
16317 airspeed_sp: 0_u8,
16318 groundspeed: 0_u8,
16319 windspeed: 0_u8,
16320 wind_heading: 0_u8,
16321 eph: 0_u8,
16322 epv: 0_u8,
16323 temperature_air: 0_i8,
16324 climb_rate: 0_i8,
16325 battery: 0_i8,
16326 custom0: 0_i8,
16327 custom1: 0_i8,
16328 custom2: 0_i8,
16329 };
16330 #[cfg(feature = "arbitrary")]
16331 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16332 use arbitrary::{Arbitrary, Unstructured};
16333 let mut buf = [0u8; 1024];
16334 rng.fill_bytes(&mut buf);
16335 let mut unstructured = Unstructured::new(&buf);
16336 Self::arbitrary(&mut unstructured).unwrap_or_default()
16337 }
16338}
16339impl Default for HIGH_LATENCY2_DATA {
16340 fn default() -> Self {
16341 Self::DEFAULT.clone()
16342 }
16343}
16344impl MessageData for HIGH_LATENCY2_DATA {
16345 type Message = MavMessage;
16346 const ID: u32 = 235u32;
16347 const NAME: &'static str = "HIGH_LATENCY2";
16348 const EXTRA_CRC: u8 = 179u8;
16349 const ENCODED_LEN: usize = 42usize;
16350 fn deser(
16351 _version: MavlinkVersion,
16352 __input: &[u8],
16353 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16354 let avail_len = __input.len();
16355 let mut payload_buf = [0; Self::ENCODED_LEN];
16356 let mut buf = if avail_len < Self::ENCODED_LEN {
16357 payload_buf[0..avail_len].copy_from_slice(__input);
16358 Bytes::new(&payload_buf)
16359 } else {
16360 Bytes::new(__input)
16361 };
16362 let mut __struct = Self::default();
16363 __struct.timestamp = buf.get_u32_le()?;
16364 __struct.latitude = buf.get_i32_le()?;
16365 __struct.longitude = buf.get_i32_le()?;
16366 __struct.custom_mode = buf.get_u16_le()?;
16367 __struct.altitude = buf.get_i16_le()?;
16368 __struct.target_altitude = buf.get_i16_le()?;
16369 __struct.target_distance = buf.get_u16_le()?;
16370 __struct.wp_num = buf.get_u16_le()?;
16371 let tmp = buf.get_u16_le()?;
16372 __struct.failure_flags = HlFailureFlag::from_bits(tmp as <HlFailureFlag as Flags>::Bits)
16373 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16374 flag_type: "HlFailureFlag",
16375 value: tmp as u64,
16376 })?;
16377 let tmp = buf.get_u8()?;
16378 __struct.mavtype =
16379 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16380 enum_type: "MavType",
16381 value: tmp as u64,
16382 })?;
16383 let tmp = buf.get_u8()?;
16384 __struct.autopilot =
16385 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16386 enum_type: "MavAutopilot",
16387 value: tmp as u64,
16388 })?;
16389 __struct.heading = buf.get_u8()?;
16390 __struct.target_heading = buf.get_u8()?;
16391 __struct.throttle = buf.get_u8()?;
16392 __struct.airspeed = buf.get_u8()?;
16393 __struct.airspeed_sp = buf.get_u8()?;
16394 __struct.groundspeed = buf.get_u8()?;
16395 __struct.windspeed = buf.get_u8()?;
16396 __struct.wind_heading = buf.get_u8()?;
16397 __struct.eph = buf.get_u8()?;
16398 __struct.epv = buf.get_u8()?;
16399 __struct.temperature_air = buf.get_i8()?;
16400 __struct.climb_rate = buf.get_i8()?;
16401 __struct.battery = buf.get_i8()?;
16402 __struct.custom0 = buf.get_i8()?;
16403 __struct.custom1 = buf.get_i8()?;
16404 __struct.custom2 = buf.get_i8()?;
16405 Ok(__struct)
16406 }
16407 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16408 let mut __tmp = BytesMut::new(bytes);
16409 #[allow(clippy::absurd_extreme_comparisons)]
16410 #[allow(unused_comparisons)]
16411 if __tmp.remaining() < Self::ENCODED_LEN {
16412 panic!(
16413 "buffer is too small (need {} bytes, but got {})",
16414 Self::ENCODED_LEN,
16415 __tmp.remaining(),
16416 )
16417 }
16418 __tmp.put_u32_le(self.timestamp);
16419 __tmp.put_i32_le(self.latitude);
16420 __tmp.put_i32_le(self.longitude);
16421 __tmp.put_u16_le(self.custom_mode);
16422 __tmp.put_i16_le(self.altitude);
16423 __tmp.put_i16_le(self.target_altitude);
16424 __tmp.put_u16_le(self.target_distance);
16425 __tmp.put_u16_le(self.wp_num);
16426 __tmp.put_u16_le(self.failure_flags.bits() as u16);
16427 __tmp.put_u8(self.mavtype as u8);
16428 __tmp.put_u8(self.autopilot as u8);
16429 __tmp.put_u8(self.heading);
16430 __tmp.put_u8(self.target_heading);
16431 __tmp.put_u8(self.throttle);
16432 __tmp.put_u8(self.airspeed);
16433 __tmp.put_u8(self.airspeed_sp);
16434 __tmp.put_u8(self.groundspeed);
16435 __tmp.put_u8(self.windspeed);
16436 __tmp.put_u8(self.wind_heading);
16437 __tmp.put_u8(self.eph);
16438 __tmp.put_u8(self.epv);
16439 __tmp.put_i8(self.temperature_air);
16440 __tmp.put_i8(self.climb_rate);
16441 __tmp.put_i8(self.battery);
16442 __tmp.put_i8(self.custom0);
16443 __tmp.put_i8(self.custom1);
16444 __tmp.put_i8(self.custom2);
16445 if matches!(version, MavlinkVersion::V2) {
16446 let len = __tmp.len();
16447 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16448 } else {
16449 __tmp.len()
16450 }
16451 }
16452}
16453#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
16454#[doc = ""]
16455#[doc = "ID: 93"]
16456#[derive(Debug, Clone, PartialEq)]
16457#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16458#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16459#[cfg_attr(feature = "ts", derive(TS))]
16460#[cfg_attr(feature = "ts", ts(export))]
16461pub struct HIL_ACTUATOR_CONTROLS_DATA {
16462 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16463 pub time_usec: u64,
16464 #[doc = "Flags bitmask."]
16465 pub flags: HilActuatorControlsFlags,
16466 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
16467 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16468 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16469 pub controls: [f32; 16],
16470 #[doc = "System mode. Includes arming state."]
16471 pub mode: MavModeFlag,
16472}
16473impl HIL_ACTUATOR_CONTROLS_DATA {
16474 pub const ENCODED_LEN: usize = 81usize;
16475 pub const DEFAULT: Self = Self {
16476 time_usec: 0_u64,
16477 flags: HilActuatorControlsFlags::DEFAULT,
16478 controls: [0.0_f32; 16usize],
16479 mode: MavModeFlag::DEFAULT,
16480 };
16481 #[cfg(feature = "arbitrary")]
16482 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16483 use arbitrary::{Arbitrary, Unstructured};
16484 let mut buf = [0u8; 1024];
16485 rng.fill_bytes(&mut buf);
16486 let mut unstructured = Unstructured::new(&buf);
16487 Self::arbitrary(&mut unstructured).unwrap_or_default()
16488 }
16489}
16490impl Default for HIL_ACTUATOR_CONTROLS_DATA {
16491 fn default() -> Self {
16492 Self::DEFAULT.clone()
16493 }
16494}
16495impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
16496 type Message = MavMessage;
16497 const ID: u32 = 93u32;
16498 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
16499 const EXTRA_CRC: u8 = 47u8;
16500 const ENCODED_LEN: usize = 81usize;
16501 fn deser(
16502 _version: MavlinkVersion,
16503 __input: &[u8],
16504 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16505 let avail_len = __input.len();
16506 let mut payload_buf = [0; Self::ENCODED_LEN];
16507 let mut buf = if avail_len < Self::ENCODED_LEN {
16508 payload_buf[0..avail_len].copy_from_slice(__input);
16509 Bytes::new(&payload_buf)
16510 } else {
16511 Bytes::new(__input)
16512 };
16513 let mut __struct = Self::default();
16514 __struct.time_usec = buf.get_u64_le()?;
16515 let tmp = buf.get_u64_le()?;
16516 __struct.flags =
16517 HilActuatorControlsFlags::from_bits(tmp as <HilActuatorControlsFlags as Flags>::Bits)
16518 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16519 flag_type: "HilActuatorControlsFlags",
16520 value: tmp as u64,
16521 })?;
16522 for v in &mut __struct.controls {
16523 let val = buf.get_f32_le()?;
16524 *v = val;
16525 }
16526 let tmp = buf.get_u8()?;
16527 __struct.mode = MavModeFlag::from_bits(tmp as <MavModeFlag as Flags>::Bits).ok_or(
16528 ::mavlink_core::error::ParserError::InvalidFlag {
16529 flag_type: "MavModeFlag",
16530 value: tmp as u64,
16531 },
16532 )?;
16533 Ok(__struct)
16534 }
16535 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16536 let mut __tmp = BytesMut::new(bytes);
16537 #[allow(clippy::absurd_extreme_comparisons)]
16538 #[allow(unused_comparisons)]
16539 if __tmp.remaining() < Self::ENCODED_LEN {
16540 panic!(
16541 "buffer is too small (need {} bytes, but got {})",
16542 Self::ENCODED_LEN,
16543 __tmp.remaining(),
16544 )
16545 }
16546 __tmp.put_u64_le(self.time_usec);
16547 __tmp.put_u64_le(self.flags.bits() as u64);
16548 for val in &self.controls {
16549 __tmp.put_f32_le(*val);
16550 }
16551 __tmp.put_u8(self.mode.bits() as u8);
16552 if matches!(version, MavlinkVersion::V2) {
16553 let len = __tmp.len();
16554 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16555 } else {
16556 __tmp.len()
16557 }
16558 }
16559}
16560#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
16561#[doc = ""]
16562#[doc = "ID: 91"]
16563#[derive(Debug, Clone, PartialEq)]
16564#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16565#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16566#[cfg_attr(feature = "ts", derive(TS))]
16567#[cfg_attr(feature = "ts", ts(export))]
16568pub struct HIL_CONTROLS_DATA {
16569 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16570 pub time_usec: u64,
16571 #[doc = "Control output -1 .. 1"]
16572 pub roll_ailerons: f32,
16573 #[doc = "Control output -1 .. 1"]
16574 pub pitch_elevator: f32,
16575 #[doc = "Control output -1 .. 1"]
16576 pub yaw_rudder: f32,
16577 #[doc = "Throttle 0 .. 1"]
16578 pub throttle: f32,
16579 #[doc = "Aux 1, -1 .. 1"]
16580 pub aux1: f32,
16581 #[doc = "Aux 2, -1 .. 1"]
16582 pub aux2: f32,
16583 #[doc = "Aux 3, -1 .. 1"]
16584 pub aux3: f32,
16585 #[doc = "Aux 4, -1 .. 1"]
16586 pub aux4: f32,
16587 #[doc = "System mode."]
16588 pub mode: MavMode,
16589 #[doc = "Navigation mode (MAV_NAV_MODE)"]
16590 pub nav_mode: u8,
16591}
16592impl HIL_CONTROLS_DATA {
16593 pub const ENCODED_LEN: usize = 42usize;
16594 pub const DEFAULT: Self = Self {
16595 time_usec: 0_u64,
16596 roll_ailerons: 0.0_f32,
16597 pitch_elevator: 0.0_f32,
16598 yaw_rudder: 0.0_f32,
16599 throttle: 0.0_f32,
16600 aux1: 0.0_f32,
16601 aux2: 0.0_f32,
16602 aux3: 0.0_f32,
16603 aux4: 0.0_f32,
16604 mode: MavMode::DEFAULT,
16605 nav_mode: 0_u8,
16606 };
16607 #[cfg(feature = "arbitrary")]
16608 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16609 use arbitrary::{Arbitrary, Unstructured};
16610 let mut buf = [0u8; 1024];
16611 rng.fill_bytes(&mut buf);
16612 let mut unstructured = Unstructured::new(&buf);
16613 Self::arbitrary(&mut unstructured).unwrap_or_default()
16614 }
16615}
16616impl Default for HIL_CONTROLS_DATA {
16617 fn default() -> Self {
16618 Self::DEFAULT.clone()
16619 }
16620}
16621impl MessageData for HIL_CONTROLS_DATA {
16622 type Message = MavMessage;
16623 const ID: u32 = 91u32;
16624 const NAME: &'static str = "HIL_CONTROLS";
16625 const EXTRA_CRC: u8 = 63u8;
16626 const ENCODED_LEN: usize = 42usize;
16627 fn deser(
16628 _version: MavlinkVersion,
16629 __input: &[u8],
16630 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16631 let avail_len = __input.len();
16632 let mut payload_buf = [0; Self::ENCODED_LEN];
16633 let mut buf = if avail_len < Self::ENCODED_LEN {
16634 payload_buf[0..avail_len].copy_from_slice(__input);
16635 Bytes::new(&payload_buf)
16636 } else {
16637 Bytes::new(__input)
16638 };
16639 let mut __struct = Self::default();
16640 __struct.time_usec = buf.get_u64_le()?;
16641 __struct.roll_ailerons = buf.get_f32_le()?;
16642 __struct.pitch_elevator = buf.get_f32_le()?;
16643 __struct.yaw_rudder = buf.get_f32_le()?;
16644 __struct.throttle = buf.get_f32_le()?;
16645 __struct.aux1 = buf.get_f32_le()?;
16646 __struct.aux2 = buf.get_f32_le()?;
16647 __struct.aux3 = buf.get_f32_le()?;
16648 __struct.aux4 = buf.get_f32_le()?;
16649 let tmp = buf.get_u8()?;
16650 __struct.mode =
16651 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16652 enum_type: "MavMode",
16653 value: tmp as u64,
16654 })?;
16655 __struct.nav_mode = buf.get_u8()?;
16656 Ok(__struct)
16657 }
16658 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16659 let mut __tmp = BytesMut::new(bytes);
16660 #[allow(clippy::absurd_extreme_comparisons)]
16661 #[allow(unused_comparisons)]
16662 if __tmp.remaining() < Self::ENCODED_LEN {
16663 panic!(
16664 "buffer is too small (need {} bytes, but got {})",
16665 Self::ENCODED_LEN,
16666 __tmp.remaining(),
16667 )
16668 }
16669 __tmp.put_u64_le(self.time_usec);
16670 __tmp.put_f32_le(self.roll_ailerons);
16671 __tmp.put_f32_le(self.pitch_elevator);
16672 __tmp.put_f32_le(self.yaw_rudder);
16673 __tmp.put_f32_le(self.throttle);
16674 __tmp.put_f32_le(self.aux1);
16675 __tmp.put_f32_le(self.aux2);
16676 __tmp.put_f32_le(self.aux3);
16677 __tmp.put_f32_le(self.aux4);
16678 __tmp.put_u8(self.mode as u8);
16679 __tmp.put_u8(self.nav_mode);
16680 if matches!(version, MavlinkVersion::V2) {
16681 let len = __tmp.len();
16682 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16683 } else {
16684 __tmp.len()
16685 }
16686 }
16687}
16688#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
16689#[doc = ""]
16690#[doc = "ID: 113"]
16691#[derive(Debug, Clone, PartialEq)]
16692#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16693#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16694#[cfg_attr(feature = "ts", derive(TS))]
16695#[cfg_attr(feature = "ts", ts(export))]
16696pub struct HIL_GPS_DATA {
16697 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16698 pub time_usec: u64,
16699 #[doc = "Latitude (WGS84)"]
16700 pub lat: i32,
16701 #[doc = "Longitude (WGS84)"]
16702 pub lon: i32,
16703 #[doc = "Altitude (MSL). Positive for up."]
16704 pub alt: i32,
16705 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16706 pub eph: u16,
16707 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16708 pub epv: u16,
16709 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
16710 pub vel: u16,
16711 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
16712 pub vn: i16,
16713 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
16714 pub ve: i16,
16715 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
16716 pub vd: i16,
16717 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
16718 pub cog: u16,
16719 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
16720 pub fix_type: u8,
16721 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
16722 pub satellites_visible: u8,
16723 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
16724 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16725 pub id: u8,
16726 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
16727 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16728 pub yaw: u16,
16729}
16730impl HIL_GPS_DATA {
16731 pub const ENCODED_LEN: usize = 39usize;
16732 pub const DEFAULT: Self = Self {
16733 time_usec: 0_u64,
16734 lat: 0_i32,
16735 lon: 0_i32,
16736 alt: 0_i32,
16737 eph: 0_u16,
16738 epv: 0_u16,
16739 vel: 0_u16,
16740 vn: 0_i16,
16741 ve: 0_i16,
16742 vd: 0_i16,
16743 cog: 0_u16,
16744 fix_type: 0_u8,
16745 satellites_visible: 0_u8,
16746 id: 0_u8,
16747 yaw: 0_u16,
16748 };
16749 #[cfg(feature = "arbitrary")]
16750 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16751 use arbitrary::{Arbitrary, Unstructured};
16752 let mut buf = [0u8; 1024];
16753 rng.fill_bytes(&mut buf);
16754 let mut unstructured = Unstructured::new(&buf);
16755 Self::arbitrary(&mut unstructured).unwrap_or_default()
16756 }
16757}
16758impl Default for HIL_GPS_DATA {
16759 fn default() -> Self {
16760 Self::DEFAULT.clone()
16761 }
16762}
16763impl MessageData for HIL_GPS_DATA {
16764 type Message = MavMessage;
16765 const ID: u32 = 113u32;
16766 const NAME: &'static str = "HIL_GPS";
16767 const EXTRA_CRC: u8 = 124u8;
16768 const ENCODED_LEN: usize = 39usize;
16769 fn deser(
16770 _version: MavlinkVersion,
16771 __input: &[u8],
16772 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16773 let avail_len = __input.len();
16774 let mut payload_buf = [0; Self::ENCODED_LEN];
16775 let mut buf = if avail_len < Self::ENCODED_LEN {
16776 payload_buf[0..avail_len].copy_from_slice(__input);
16777 Bytes::new(&payload_buf)
16778 } else {
16779 Bytes::new(__input)
16780 };
16781 let mut __struct = Self::default();
16782 __struct.time_usec = buf.get_u64_le()?;
16783 __struct.lat = buf.get_i32_le()?;
16784 __struct.lon = buf.get_i32_le()?;
16785 __struct.alt = buf.get_i32_le()?;
16786 __struct.eph = buf.get_u16_le()?;
16787 __struct.epv = buf.get_u16_le()?;
16788 __struct.vel = buf.get_u16_le()?;
16789 __struct.vn = buf.get_i16_le()?;
16790 __struct.ve = buf.get_i16_le()?;
16791 __struct.vd = buf.get_i16_le()?;
16792 __struct.cog = buf.get_u16_le()?;
16793 __struct.fix_type = buf.get_u8()?;
16794 __struct.satellites_visible = buf.get_u8()?;
16795 __struct.id = buf.get_u8()?;
16796 __struct.yaw = buf.get_u16_le()?;
16797 Ok(__struct)
16798 }
16799 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16800 let mut __tmp = BytesMut::new(bytes);
16801 #[allow(clippy::absurd_extreme_comparisons)]
16802 #[allow(unused_comparisons)]
16803 if __tmp.remaining() < Self::ENCODED_LEN {
16804 panic!(
16805 "buffer is too small (need {} bytes, but got {})",
16806 Self::ENCODED_LEN,
16807 __tmp.remaining(),
16808 )
16809 }
16810 __tmp.put_u64_le(self.time_usec);
16811 __tmp.put_i32_le(self.lat);
16812 __tmp.put_i32_le(self.lon);
16813 __tmp.put_i32_le(self.alt);
16814 __tmp.put_u16_le(self.eph);
16815 __tmp.put_u16_le(self.epv);
16816 __tmp.put_u16_le(self.vel);
16817 __tmp.put_i16_le(self.vn);
16818 __tmp.put_i16_le(self.ve);
16819 __tmp.put_i16_le(self.vd);
16820 __tmp.put_u16_le(self.cog);
16821 __tmp.put_u8(self.fix_type);
16822 __tmp.put_u8(self.satellites_visible);
16823 if matches!(version, MavlinkVersion::V2) {
16824 __tmp.put_u8(self.id);
16825 __tmp.put_u16_le(self.yaw);
16826 let len = __tmp.len();
16827 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16828 } else {
16829 __tmp.len()
16830 }
16831 }
16832}
16833#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
16834#[doc = ""]
16835#[doc = "ID: 114"]
16836#[derive(Debug, Clone, PartialEq)]
16837#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16838#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16839#[cfg_attr(feature = "ts", derive(TS))]
16840#[cfg_attr(feature = "ts", ts(export))]
16841pub struct HIL_OPTICAL_FLOW_DATA {
16842 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16843 pub time_usec: u64,
16844 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
16845 pub integration_time_us: u32,
16846 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
16847 pub integrated_x: f32,
16848 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
16849 pub integrated_y: f32,
16850 #[doc = "RH rotation around X axis"]
16851 pub integrated_xgyro: f32,
16852 #[doc = "RH rotation around Y axis"]
16853 pub integrated_ygyro: f32,
16854 #[doc = "RH rotation around Z axis"]
16855 pub integrated_zgyro: f32,
16856 #[doc = "Time since the distance was sampled."]
16857 pub time_delta_distance_us: u32,
16858 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
16859 pub distance: f32,
16860 #[doc = "Temperature"]
16861 pub temperature: i16,
16862 #[doc = "Sensor ID"]
16863 pub sensor_id: u8,
16864 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
16865 pub quality: u8,
16866}
16867impl HIL_OPTICAL_FLOW_DATA {
16868 pub const ENCODED_LEN: usize = 44usize;
16869 pub const DEFAULT: Self = Self {
16870 time_usec: 0_u64,
16871 integration_time_us: 0_u32,
16872 integrated_x: 0.0_f32,
16873 integrated_y: 0.0_f32,
16874 integrated_xgyro: 0.0_f32,
16875 integrated_ygyro: 0.0_f32,
16876 integrated_zgyro: 0.0_f32,
16877 time_delta_distance_us: 0_u32,
16878 distance: 0.0_f32,
16879 temperature: 0_i16,
16880 sensor_id: 0_u8,
16881 quality: 0_u8,
16882 };
16883 #[cfg(feature = "arbitrary")]
16884 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16885 use arbitrary::{Arbitrary, Unstructured};
16886 let mut buf = [0u8; 1024];
16887 rng.fill_bytes(&mut buf);
16888 let mut unstructured = Unstructured::new(&buf);
16889 Self::arbitrary(&mut unstructured).unwrap_or_default()
16890 }
16891}
16892impl Default for HIL_OPTICAL_FLOW_DATA {
16893 fn default() -> Self {
16894 Self::DEFAULT.clone()
16895 }
16896}
16897impl MessageData for HIL_OPTICAL_FLOW_DATA {
16898 type Message = MavMessage;
16899 const ID: u32 = 114u32;
16900 const NAME: &'static str = "HIL_OPTICAL_FLOW";
16901 const EXTRA_CRC: u8 = 237u8;
16902 const ENCODED_LEN: usize = 44usize;
16903 fn deser(
16904 _version: MavlinkVersion,
16905 __input: &[u8],
16906 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16907 let avail_len = __input.len();
16908 let mut payload_buf = [0; Self::ENCODED_LEN];
16909 let mut buf = if avail_len < Self::ENCODED_LEN {
16910 payload_buf[0..avail_len].copy_from_slice(__input);
16911 Bytes::new(&payload_buf)
16912 } else {
16913 Bytes::new(__input)
16914 };
16915 let mut __struct = Self::default();
16916 __struct.time_usec = buf.get_u64_le()?;
16917 __struct.integration_time_us = buf.get_u32_le()?;
16918 __struct.integrated_x = buf.get_f32_le()?;
16919 __struct.integrated_y = buf.get_f32_le()?;
16920 __struct.integrated_xgyro = buf.get_f32_le()?;
16921 __struct.integrated_ygyro = buf.get_f32_le()?;
16922 __struct.integrated_zgyro = buf.get_f32_le()?;
16923 __struct.time_delta_distance_us = buf.get_u32_le()?;
16924 __struct.distance = buf.get_f32_le()?;
16925 __struct.temperature = buf.get_i16_le()?;
16926 __struct.sensor_id = buf.get_u8()?;
16927 __struct.quality = buf.get_u8()?;
16928 Ok(__struct)
16929 }
16930 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16931 let mut __tmp = BytesMut::new(bytes);
16932 #[allow(clippy::absurd_extreme_comparisons)]
16933 #[allow(unused_comparisons)]
16934 if __tmp.remaining() < Self::ENCODED_LEN {
16935 panic!(
16936 "buffer is too small (need {} bytes, but got {})",
16937 Self::ENCODED_LEN,
16938 __tmp.remaining(),
16939 )
16940 }
16941 __tmp.put_u64_le(self.time_usec);
16942 __tmp.put_u32_le(self.integration_time_us);
16943 __tmp.put_f32_le(self.integrated_x);
16944 __tmp.put_f32_le(self.integrated_y);
16945 __tmp.put_f32_le(self.integrated_xgyro);
16946 __tmp.put_f32_le(self.integrated_ygyro);
16947 __tmp.put_f32_le(self.integrated_zgyro);
16948 __tmp.put_u32_le(self.time_delta_distance_us);
16949 __tmp.put_f32_le(self.distance);
16950 __tmp.put_i16_le(self.temperature);
16951 __tmp.put_u8(self.sensor_id);
16952 __tmp.put_u8(self.quality);
16953 if matches!(version, MavlinkVersion::V2) {
16954 let len = __tmp.len();
16955 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16956 } else {
16957 __tmp.len()
16958 }
16959 }
16960}
16961#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
16962#[doc = ""]
16963#[doc = "ID: 92"]
16964#[derive(Debug, Clone, PartialEq)]
16965#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16966#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16967#[cfg_attr(feature = "ts", derive(TS))]
16968#[cfg_attr(feature = "ts", ts(export))]
16969pub struct HIL_RC_INPUTS_RAW_DATA {
16970 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16971 pub time_usec: u64,
16972 #[doc = "RC channel 1 value"]
16973 pub chan1_raw: u16,
16974 #[doc = "RC channel 2 value"]
16975 pub chan2_raw: u16,
16976 #[doc = "RC channel 3 value"]
16977 pub chan3_raw: u16,
16978 #[doc = "RC channel 4 value"]
16979 pub chan4_raw: u16,
16980 #[doc = "RC channel 5 value"]
16981 pub chan5_raw: u16,
16982 #[doc = "RC channel 6 value"]
16983 pub chan6_raw: u16,
16984 #[doc = "RC channel 7 value"]
16985 pub chan7_raw: u16,
16986 #[doc = "RC channel 8 value"]
16987 pub chan8_raw: u16,
16988 #[doc = "RC channel 9 value"]
16989 pub chan9_raw: u16,
16990 #[doc = "RC channel 10 value"]
16991 pub chan10_raw: u16,
16992 #[doc = "RC channel 11 value"]
16993 pub chan11_raw: u16,
16994 #[doc = "RC channel 12 value"]
16995 pub chan12_raw: u16,
16996 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
16997 pub rssi: u8,
16998}
16999impl HIL_RC_INPUTS_RAW_DATA {
17000 pub const ENCODED_LEN: usize = 33usize;
17001 pub const DEFAULT: Self = Self {
17002 time_usec: 0_u64,
17003 chan1_raw: 0_u16,
17004 chan2_raw: 0_u16,
17005 chan3_raw: 0_u16,
17006 chan4_raw: 0_u16,
17007 chan5_raw: 0_u16,
17008 chan6_raw: 0_u16,
17009 chan7_raw: 0_u16,
17010 chan8_raw: 0_u16,
17011 chan9_raw: 0_u16,
17012 chan10_raw: 0_u16,
17013 chan11_raw: 0_u16,
17014 chan12_raw: 0_u16,
17015 rssi: 0_u8,
17016 };
17017 #[cfg(feature = "arbitrary")]
17018 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17019 use arbitrary::{Arbitrary, Unstructured};
17020 let mut buf = [0u8; 1024];
17021 rng.fill_bytes(&mut buf);
17022 let mut unstructured = Unstructured::new(&buf);
17023 Self::arbitrary(&mut unstructured).unwrap_or_default()
17024 }
17025}
17026impl Default for HIL_RC_INPUTS_RAW_DATA {
17027 fn default() -> Self {
17028 Self::DEFAULT.clone()
17029 }
17030}
17031impl MessageData for HIL_RC_INPUTS_RAW_DATA {
17032 type Message = MavMessage;
17033 const ID: u32 = 92u32;
17034 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
17035 const EXTRA_CRC: u8 = 54u8;
17036 const ENCODED_LEN: usize = 33usize;
17037 fn deser(
17038 _version: MavlinkVersion,
17039 __input: &[u8],
17040 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17041 let avail_len = __input.len();
17042 let mut payload_buf = [0; Self::ENCODED_LEN];
17043 let mut buf = if avail_len < Self::ENCODED_LEN {
17044 payload_buf[0..avail_len].copy_from_slice(__input);
17045 Bytes::new(&payload_buf)
17046 } else {
17047 Bytes::new(__input)
17048 };
17049 let mut __struct = Self::default();
17050 __struct.time_usec = buf.get_u64_le()?;
17051 __struct.chan1_raw = buf.get_u16_le()?;
17052 __struct.chan2_raw = buf.get_u16_le()?;
17053 __struct.chan3_raw = buf.get_u16_le()?;
17054 __struct.chan4_raw = buf.get_u16_le()?;
17055 __struct.chan5_raw = buf.get_u16_le()?;
17056 __struct.chan6_raw = buf.get_u16_le()?;
17057 __struct.chan7_raw = buf.get_u16_le()?;
17058 __struct.chan8_raw = buf.get_u16_le()?;
17059 __struct.chan9_raw = buf.get_u16_le()?;
17060 __struct.chan10_raw = buf.get_u16_le()?;
17061 __struct.chan11_raw = buf.get_u16_le()?;
17062 __struct.chan12_raw = buf.get_u16_le()?;
17063 __struct.rssi = buf.get_u8()?;
17064 Ok(__struct)
17065 }
17066 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17067 let mut __tmp = BytesMut::new(bytes);
17068 #[allow(clippy::absurd_extreme_comparisons)]
17069 #[allow(unused_comparisons)]
17070 if __tmp.remaining() < Self::ENCODED_LEN {
17071 panic!(
17072 "buffer is too small (need {} bytes, but got {})",
17073 Self::ENCODED_LEN,
17074 __tmp.remaining(),
17075 )
17076 }
17077 __tmp.put_u64_le(self.time_usec);
17078 __tmp.put_u16_le(self.chan1_raw);
17079 __tmp.put_u16_le(self.chan2_raw);
17080 __tmp.put_u16_le(self.chan3_raw);
17081 __tmp.put_u16_le(self.chan4_raw);
17082 __tmp.put_u16_le(self.chan5_raw);
17083 __tmp.put_u16_le(self.chan6_raw);
17084 __tmp.put_u16_le(self.chan7_raw);
17085 __tmp.put_u16_le(self.chan8_raw);
17086 __tmp.put_u16_le(self.chan9_raw);
17087 __tmp.put_u16_le(self.chan10_raw);
17088 __tmp.put_u16_le(self.chan11_raw);
17089 __tmp.put_u16_le(self.chan12_raw);
17090 __tmp.put_u8(self.rssi);
17091 if matches!(version, MavlinkVersion::V2) {
17092 let len = __tmp.len();
17093 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17094 } else {
17095 __tmp.len()
17096 }
17097 }
17098}
17099#[doc = "The IMU readings in SI units in NED body frame."]
17100#[doc = ""]
17101#[doc = "ID: 107"]
17102#[derive(Debug, Clone, PartialEq)]
17103#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17104#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17105#[cfg_attr(feature = "ts", derive(TS))]
17106#[cfg_attr(feature = "ts", ts(export))]
17107pub struct HIL_SENSOR_DATA {
17108 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17109 pub time_usec: u64,
17110 #[doc = "X acceleration"]
17111 pub xacc: f32,
17112 #[doc = "Y acceleration"]
17113 pub yacc: f32,
17114 #[doc = "Z acceleration"]
17115 pub zacc: f32,
17116 #[doc = "Angular speed around X axis in body frame"]
17117 pub xgyro: f32,
17118 #[doc = "Angular speed around Y axis in body frame"]
17119 pub ygyro: f32,
17120 #[doc = "Angular speed around Z axis in body frame"]
17121 pub zgyro: f32,
17122 #[doc = "X Magnetic field"]
17123 pub xmag: f32,
17124 #[doc = "Y Magnetic field"]
17125 pub ymag: f32,
17126 #[doc = "Z Magnetic field"]
17127 pub zmag: f32,
17128 #[doc = "Absolute pressure"]
17129 pub abs_pressure: f32,
17130 #[doc = "Differential pressure (airspeed)"]
17131 pub diff_pressure: f32,
17132 #[doc = "Altitude calculated from pressure"]
17133 pub pressure_alt: f32,
17134 #[doc = "Temperature"]
17135 pub temperature: f32,
17136 #[doc = "Bitmap for fields that have updated since last message"]
17137 pub fields_updated: HilSensorUpdatedFlags,
17138 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
17139 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17140 pub id: u8,
17141}
17142impl HIL_SENSOR_DATA {
17143 pub const ENCODED_LEN: usize = 65usize;
17144 pub const DEFAULT: Self = Self {
17145 time_usec: 0_u64,
17146 xacc: 0.0_f32,
17147 yacc: 0.0_f32,
17148 zacc: 0.0_f32,
17149 xgyro: 0.0_f32,
17150 ygyro: 0.0_f32,
17151 zgyro: 0.0_f32,
17152 xmag: 0.0_f32,
17153 ymag: 0.0_f32,
17154 zmag: 0.0_f32,
17155 abs_pressure: 0.0_f32,
17156 diff_pressure: 0.0_f32,
17157 pressure_alt: 0.0_f32,
17158 temperature: 0.0_f32,
17159 fields_updated: HilSensorUpdatedFlags::DEFAULT,
17160 id: 0_u8,
17161 };
17162 #[cfg(feature = "arbitrary")]
17163 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17164 use arbitrary::{Arbitrary, Unstructured};
17165 let mut buf = [0u8; 1024];
17166 rng.fill_bytes(&mut buf);
17167 let mut unstructured = Unstructured::new(&buf);
17168 Self::arbitrary(&mut unstructured).unwrap_or_default()
17169 }
17170}
17171impl Default for HIL_SENSOR_DATA {
17172 fn default() -> Self {
17173 Self::DEFAULT.clone()
17174 }
17175}
17176impl MessageData for HIL_SENSOR_DATA {
17177 type Message = MavMessage;
17178 const ID: u32 = 107u32;
17179 const NAME: &'static str = "HIL_SENSOR";
17180 const EXTRA_CRC: u8 = 108u8;
17181 const ENCODED_LEN: usize = 65usize;
17182 fn deser(
17183 _version: MavlinkVersion,
17184 __input: &[u8],
17185 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17186 let avail_len = __input.len();
17187 let mut payload_buf = [0; Self::ENCODED_LEN];
17188 let mut buf = if avail_len < Self::ENCODED_LEN {
17189 payload_buf[0..avail_len].copy_from_slice(__input);
17190 Bytes::new(&payload_buf)
17191 } else {
17192 Bytes::new(__input)
17193 };
17194 let mut __struct = Self::default();
17195 __struct.time_usec = buf.get_u64_le()?;
17196 __struct.xacc = buf.get_f32_le()?;
17197 __struct.yacc = buf.get_f32_le()?;
17198 __struct.zacc = buf.get_f32_le()?;
17199 __struct.xgyro = buf.get_f32_le()?;
17200 __struct.ygyro = buf.get_f32_le()?;
17201 __struct.zgyro = buf.get_f32_le()?;
17202 __struct.xmag = buf.get_f32_le()?;
17203 __struct.ymag = buf.get_f32_le()?;
17204 __struct.zmag = buf.get_f32_le()?;
17205 __struct.abs_pressure = buf.get_f32_le()?;
17206 __struct.diff_pressure = buf.get_f32_le()?;
17207 __struct.pressure_alt = buf.get_f32_le()?;
17208 __struct.temperature = buf.get_f32_le()?;
17209 let tmp = buf.get_u32_le()?;
17210 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
17211 tmp as <HilSensorUpdatedFlags as Flags>::Bits,
17212 )
17213 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17214 flag_type: "HilSensorUpdatedFlags",
17215 value: tmp as u64,
17216 })?;
17217 __struct.id = buf.get_u8()?;
17218 Ok(__struct)
17219 }
17220 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17221 let mut __tmp = BytesMut::new(bytes);
17222 #[allow(clippy::absurd_extreme_comparisons)]
17223 #[allow(unused_comparisons)]
17224 if __tmp.remaining() < Self::ENCODED_LEN {
17225 panic!(
17226 "buffer is too small (need {} bytes, but got {})",
17227 Self::ENCODED_LEN,
17228 __tmp.remaining(),
17229 )
17230 }
17231 __tmp.put_u64_le(self.time_usec);
17232 __tmp.put_f32_le(self.xacc);
17233 __tmp.put_f32_le(self.yacc);
17234 __tmp.put_f32_le(self.zacc);
17235 __tmp.put_f32_le(self.xgyro);
17236 __tmp.put_f32_le(self.ygyro);
17237 __tmp.put_f32_le(self.zgyro);
17238 __tmp.put_f32_le(self.xmag);
17239 __tmp.put_f32_le(self.ymag);
17240 __tmp.put_f32_le(self.zmag);
17241 __tmp.put_f32_le(self.abs_pressure);
17242 __tmp.put_f32_le(self.diff_pressure);
17243 __tmp.put_f32_le(self.pressure_alt);
17244 __tmp.put_f32_le(self.temperature);
17245 __tmp.put_u32_le(self.fields_updated.bits() as u32);
17246 if matches!(version, MavlinkVersion::V2) {
17247 __tmp.put_u8(self.id);
17248 let len = __tmp.len();
17249 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17250 } else {
17251 __tmp.len()
17252 }
17253 }
17254}
17255#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
17256#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
17257#[doc = ""]
17258#[doc = "ID: 90"]
17259#[derive(Debug, Clone, PartialEq)]
17260#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17261#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17262#[cfg_attr(feature = "ts", derive(TS))]
17263#[cfg_attr(feature = "ts", ts(export))]
17264pub struct HIL_STATE_DATA {
17265 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17266 pub time_usec: u64,
17267 #[doc = "Roll angle"]
17268 pub roll: f32,
17269 #[doc = "Pitch angle"]
17270 pub pitch: f32,
17271 #[doc = "Yaw angle"]
17272 pub yaw: f32,
17273 #[doc = "Body frame roll / phi angular speed"]
17274 pub rollspeed: f32,
17275 #[doc = "Body frame pitch / theta angular speed"]
17276 pub pitchspeed: f32,
17277 #[doc = "Body frame yaw / psi angular speed"]
17278 pub yawspeed: f32,
17279 #[doc = "Latitude"]
17280 pub lat: i32,
17281 #[doc = "Longitude"]
17282 pub lon: i32,
17283 #[doc = "Altitude"]
17284 pub alt: i32,
17285 #[doc = "Ground X Speed (Latitude)"]
17286 pub vx: i16,
17287 #[doc = "Ground Y Speed (Longitude)"]
17288 pub vy: i16,
17289 #[doc = "Ground Z Speed (Altitude)"]
17290 pub vz: i16,
17291 #[doc = "X acceleration"]
17292 pub xacc: i16,
17293 #[doc = "Y acceleration"]
17294 pub yacc: i16,
17295 #[doc = "Z acceleration"]
17296 pub zacc: i16,
17297}
17298impl HIL_STATE_DATA {
17299 pub const ENCODED_LEN: usize = 56usize;
17300 pub const DEFAULT: Self = Self {
17301 time_usec: 0_u64,
17302 roll: 0.0_f32,
17303 pitch: 0.0_f32,
17304 yaw: 0.0_f32,
17305 rollspeed: 0.0_f32,
17306 pitchspeed: 0.0_f32,
17307 yawspeed: 0.0_f32,
17308 lat: 0_i32,
17309 lon: 0_i32,
17310 alt: 0_i32,
17311 vx: 0_i16,
17312 vy: 0_i16,
17313 vz: 0_i16,
17314 xacc: 0_i16,
17315 yacc: 0_i16,
17316 zacc: 0_i16,
17317 };
17318 #[cfg(feature = "arbitrary")]
17319 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17320 use arbitrary::{Arbitrary, Unstructured};
17321 let mut buf = [0u8; 1024];
17322 rng.fill_bytes(&mut buf);
17323 let mut unstructured = Unstructured::new(&buf);
17324 Self::arbitrary(&mut unstructured).unwrap_or_default()
17325 }
17326}
17327impl Default for HIL_STATE_DATA {
17328 fn default() -> Self {
17329 Self::DEFAULT.clone()
17330 }
17331}
17332impl MessageData for HIL_STATE_DATA {
17333 type Message = MavMessage;
17334 const ID: u32 = 90u32;
17335 const NAME: &'static str = "HIL_STATE";
17336 const EXTRA_CRC: u8 = 183u8;
17337 const ENCODED_LEN: usize = 56usize;
17338 fn deser(
17339 _version: MavlinkVersion,
17340 __input: &[u8],
17341 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17342 let avail_len = __input.len();
17343 let mut payload_buf = [0; Self::ENCODED_LEN];
17344 let mut buf = if avail_len < Self::ENCODED_LEN {
17345 payload_buf[0..avail_len].copy_from_slice(__input);
17346 Bytes::new(&payload_buf)
17347 } else {
17348 Bytes::new(__input)
17349 };
17350 let mut __struct = Self::default();
17351 __struct.time_usec = buf.get_u64_le()?;
17352 __struct.roll = buf.get_f32_le()?;
17353 __struct.pitch = buf.get_f32_le()?;
17354 __struct.yaw = buf.get_f32_le()?;
17355 __struct.rollspeed = buf.get_f32_le()?;
17356 __struct.pitchspeed = buf.get_f32_le()?;
17357 __struct.yawspeed = buf.get_f32_le()?;
17358 __struct.lat = buf.get_i32_le()?;
17359 __struct.lon = buf.get_i32_le()?;
17360 __struct.alt = buf.get_i32_le()?;
17361 __struct.vx = buf.get_i16_le()?;
17362 __struct.vy = buf.get_i16_le()?;
17363 __struct.vz = buf.get_i16_le()?;
17364 __struct.xacc = buf.get_i16_le()?;
17365 __struct.yacc = buf.get_i16_le()?;
17366 __struct.zacc = buf.get_i16_le()?;
17367 Ok(__struct)
17368 }
17369 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17370 let mut __tmp = BytesMut::new(bytes);
17371 #[allow(clippy::absurd_extreme_comparisons)]
17372 #[allow(unused_comparisons)]
17373 if __tmp.remaining() < Self::ENCODED_LEN {
17374 panic!(
17375 "buffer is too small (need {} bytes, but got {})",
17376 Self::ENCODED_LEN,
17377 __tmp.remaining(),
17378 )
17379 }
17380 __tmp.put_u64_le(self.time_usec);
17381 __tmp.put_f32_le(self.roll);
17382 __tmp.put_f32_le(self.pitch);
17383 __tmp.put_f32_le(self.yaw);
17384 __tmp.put_f32_le(self.rollspeed);
17385 __tmp.put_f32_le(self.pitchspeed);
17386 __tmp.put_f32_le(self.yawspeed);
17387 __tmp.put_i32_le(self.lat);
17388 __tmp.put_i32_le(self.lon);
17389 __tmp.put_i32_le(self.alt);
17390 __tmp.put_i16_le(self.vx);
17391 __tmp.put_i16_le(self.vy);
17392 __tmp.put_i16_le(self.vz);
17393 __tmp.put_i16_le(self.xacc);
17394 __tmp.put_i16_le(self.yacc);
17395 __tmp.put_i16_le(self.zacc);
17396 if matches!(version, MavlinkVersion::V2) {
17397 let len = __tmp.len();
17398 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17399 } else {
17400 __tmp.len()
17401 }
17402 }
17403}
17404#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
17405#[doc = ""]
17406#[doc = "ID: 115"]
17407#[derive(Debug, Clone, PartialEq)]
17408#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17409#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17410#[cfg_attr(feature = "ts", derive(TS))]
17411#[cfg_attr(feature = "ts", ts(export))]
17412pub struct HIL_STATE_QUATERNION_DATA {
17413 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17414 pub time_usec: u64,
17415 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
17416 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17417 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17418 pub attitude_quaternion: [f32; 4],
17419 #[doc = "Body frame roll / phi angular speed"]
17420 pub rollspeed: f32,
17421 #[doc = "Body frame pitch / theta angular speed"]
17422 pub pitchspeed: f32,
17423 #[doc = "Body frame yaw / psi angular speed"]
17424 pub yawspeed: f32,
17425 #[doc = "Latitude"]
17426 pub lat: i32,
17427 #[doc = "Longitude"]
17428 pub lon: i32,
17429 #[doc = "Altitude"]
17430 pub alt: i32,
17431 #[doc = "Ground X Speed (Latitude)"]
17432 pub vx: i16,
17433 #[doc = "Ground Y Speed (Longitude)"]
17434 pub vy: i16,
17435 #[doc = "Ground Z Speed (Altitude)"]
17436 pub vz: i16,
17437 #[doc = "Indicated airspeed"]
17438 pub ind_airspeed: u16,
17439 #[doc = "True airspeed"]
17440 pub true_airspeed: u16,
17441 #[doc = "X acceleration"]
17442 pub xacc: i16,
17443 #[doc = "Y acceleration"]
17444 pub yacc: i16,
17445 #[doc = "Z acceleration"]
17446 pub zacc: i16,
17447}
17448impl HIL_STATE_QUATERNION_DATA {
17449 pub const ENCODED_LEN: usize = 64usize;
17450 pub const DEFAULT: Self = Self {
17451 time_usec: 0_u64,
17452 attitude_quaternion: [0.0_f32; 4usize],
17453 rollspeed: 0.0_f32,
17454 pitchspeed: 0.0_f32,
17455 yawspeed: 0.0_f32,
17456 lat: 0_i32,
17457 lon: 0_i32,
17458 alt: 0_i32,
17459 vx: 0_i16,
17460 vy: 0_i16,
17461 vz: 0_i16,
17462 ind_airspeed: 0_u16,
17463 true_airspeed: 0_u16,
17464 xacc: 0_i16,
17465 yacc: 0_i16,
17466 zacc: 0_i16,
17467 };
17468 #[cfg(feature = "arbitrary")]
17469 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17470 use arbitrary::{Arbitrary, Unstructured};
17471 let mut buf = [0u8; 1024];
17472 rng.fill_bytes(&mut buf);
17473 let mut unstructured = Unstructured::new(&buf);
17474 Self::arbitrary(&mut unstructured).unwrap_or_default()
17475 }
17476}
17477impl Default for HIL_STATE_QUATERNION_DATA {
17478 fn default() -> Self {
17479 Self::DEFAULT.clone()
17480 }
17481}
17482impl MessageData for HIL_STATE_QUATERNION_DATA {
17483 type Message = MavMessage;
17484 const ID: u32 = 115u32;
17485 const NAME: &'static str = "HIL_STATE_QUATERNION";
17486 const EXTRA_CRC: u8 = 4u8;
17487 const ENCODED_LEN: usize = 64usize;
17488 fn deser(
17489 _version: MavlinkVersion,
17490 __input: &[u8],
17491 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17492 let avail_len = __input.len();
17493 let mut payload_buf = [0; Self::ENCODED_LEN];
17494 let mut buf = if avail_len < Self::ENCODED_LEN {
17495 payload_buf[0..avail_len].copy_from_slice(__input);
17496 Bytes::new(&payload_buf)
17497 } else {
17498 Bytes::new(__input)
17499 };
17500 let mut __struct = Self::default();
17501 __struct.time_usec = buf.get_u64_le()?;
17502 for v in &mut __struct.attitude_quaternion {
17503 let val = buf.get_f32_le()?;
17504 *v = val;
17505 }
17506 __struct.rollspeed = buf.get_f32_le()?;
17507 __struct.pitchspeed = buf.get_f32_le()?;
17508 __struct.yawspeed = buf.get_f32_le()?;
17509 __struct.lat = buf.get_i32_le()?;
17510 __struct.lon = buf.get_i32_le()?;
17511 __struct.alt = buf.get_i32_le()?;
17512 __struct.vx = buf.get_i16_le()?;
17513 __struct.vy = buf.get_i16_le()?;
17514 __struct.vz = buf.get_i16_le()?;
17515 __struct.ind_airspeed = buf.get_u16_le()?;
17516 __struct.true_airspeed = buf.get_u16_le()?;
17517 __struct.xacc = buf.get_i16_le()?;
17518 __struct.yacc = buf.get_i16_le()?;
17519 __struct.zacc = buf.get_i16_le()?;
17520 Ok(__struct)
17521 }
17522 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17523 let mut __tmp = BytesMut::new(bytes);
17524 #[allow(clippy::absurd_extreme_comparisons)]
17525 #[allow(unused_comparisons)]
17526 if __tmp.remaining() < Self::ENCODED_LEN {
17527 panic!(
17528 "buffer is too small (need {} bytes, but got {})",
17529 Self::ENCODED_LEN,
17530 __tmp.remaining(),
17531 )
17532 }
17533 __tmp.put_u64_le(self.time_usec);
17534 for val in &self.attitude_quaternion {
17535 __tmp.put_f32_le(*val);
17536 }
17537 __tmp.put_f32_le(self.rollspeed);
17538 __tmp.put_f32_le(self.pitchspeed);
17539 __tmp.put_f32_le(self.yawspeed);
17540 __tmp.put_i32_le(self.lat);
17541 __tmp.put_i32_le(self.lon);
17542 __tmp.put_i32_le(self.alt);
17543 __tmp.put_i16_le(self.vx);
17544 __tmp.put_i16_le(self.vy);
17545 __tmp.put_i16_le(self.vz);
17546 __tmp.put_u16_le(self.ind_airspeed);
17547 __tmp.put_u16_le(self.true_airspeed);
17548 __tmp.put_i16_le(self.xacc);
17549 __tmp.put_i16_le(self.yacc);
17550 __tmp.put_i16_le(self.zacc);
17551 if matches!(version, MavlinkVersion::V2) {
17552 let len = __tmp.len();
17553 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17554 } else {
17555 __tmp.len()
17556 }
17557 }
17558}
17559#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
17560#[doc = ""]
17561#[doc = "ID: 242"]
17562#[derive(Debug, Clone, PartialEq)]
17563#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17564#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17565#[cfg_attr(feature = "ts", derive(TS))]
17566#[cfg_attr(feature = "ts", ts(export))]
17567pub struct HOME_POSITION_DATA {
17568 #[doc = "Latitude (WGS84)"]
17569 pub latitude: i32,
17570 #[doc = "Longitude (WGS84)"]
17571 pub longitude: i32,
17572 #[doc = "Altitude (MSL). Positive for up."]
17573 pub altitude: i32,
17574 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
17575 pub x: f32,
17576 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
17577 pub y: f32,
17578 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
17579 pub z: f32,
17580 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
17581 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17582 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17583 pub q: [f32; 4],
17584 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17585 pub approach_x: f32,
17586 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17587 pub approach_y: f32,
17588 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17589 pub approach_z: f32,
17590 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17591 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17592 pub time_usec: u64,
17593}
17594impl HOME_POSITION_DATA {
17595 pub const ENCODED_LEN: usize = 60usize;
17596 pub const DEFAULT: Self = Self {
17597 latitude: 0_i32,
17598 longitude: 0_i32,
17599 altitude: 0_i32,
17600 x: 0.0_f32,
17601 y: 0.0_f32,
17602 z: 0.0_f32,
17603 q: [0.0_f32; 4usize],
17604 approach_x: 0.0_f32,
17605 approach_y: 0.0_f32,
17606 approach_z: 0.0_f32,
17607 time_usec: 0_u64,
17608 };
17609 #[cfg(feature = "arbitrary")]
17610 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17611 use arbitrary::{Arbitrary, Unstructured};
17612 let mut buf = [0u8; 1024];
17613 rng.fill_bytes(&mut buf);
17614 let mut unstructured = Unstructured::new(&buf);
17615 Self::arbitrary(&mut unstructured).unwrap_or_default()
17616 }
17617}
17618impl Default for HOME_POSITION_DATA {
17619 fn default() -> Self {
17620 Self::DEFAULT.clone()
17621 }
17622}
17623impl MessageData for HOME_POSITION_DATA {
17624 type Message = MavMessage;
17625 const ID: u32 = 242u32;
17626 const NAME: &'static str = "HOME_POSITION";
17627 const EXTRA_CRC: u8 = 104u8;
17628 const ENCODED_LEN: usize = 60usize;
17629 fn deser(
17630 _version: MavlinkVersion,
17631 __input: &[u8],
17632 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17633 let avail_len = __input.len();
17634 let mut payload_buf = [0; Self::ENCODED_LEN];
17635 let mut buf = if avail_len < Self::ENCODED_LEN {
17636 payload_buf[0..avail_len].copy_from_slice(__input);
17637 Bytes::new(&payload_buf)
17638 } else {
17639 Bytes::new(__input)
17640 };
17641 let mut __struct = Self::default();
17642 __struct.latitude = buf.get_i32_le()?;
17643 __struct.longitude = buf.get_i32_le()?;
17644 __struct.altitude = buf.get_i32_le()?;
17645 __struct.x = buf.get_f32_le()?;
17646 __struct.y = buf.get_f32_le()?;
17647 __struct.z = buf.get_f32_le()?;
17648 for v in &mut __struct.q {
17649 let val = buf.get_f32_le()?;
17650 *v = val;
17651 }
17652 __struct.approach_x = buf.get_f32_le()?;
17653 __struct.approach_y = buf.get_f32_le()?;
17654 __struct.approach_z = buf.get_f32_le()?;
17655 __struct.time_usec = buf.get_u64_le()?;
17656 Ok(__struct)
17657 }
17658 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17659 let mut __tmp = BytesMut::new(bytes);
17660 #[allow(clippy::absurd_extreme_comparisons)]
17661 #[allow(unused_comparisons)]
17662 if __tmp.remaining() < Self::ENCODED_LEN {
17663 panic!(
17664 "buffer is too small (need {} bytes, but got {})",
17665 Self::ENCODED_LEN,
17666 __tmp.remaining(),
17667 )
17668 }
17669 __tmp.put_i32_le(self.latitude);
17670 __tmp.put_i32_le(self.longitude);
17671 __tmp.put_i32_le(self.altitude);
17672 __tmp.put_f32_le(self.x);
17673 __tmp.put_f32_le(self.y);
17674 __tmp.put_f32_le(self.z);
17675 for val in &self.q {
17676 __tmp.put_f32_le(*val);
17677 }
17678 __tmp.put_f32_le(self.approach_x);
17679 __tmp.put_f32_le(self.approach_y);
17680 __tmp.put_f32_le(self.approach_z);
17681 if matches!(version, MavlinkVersion::V2) {
17682 __tmp.put_u64_le(self.time_usec);
17683 let len = __tmp.len();
17684 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17685 } else {
17686 __tmp.len()
17687 }
17688 }
17689}
17690#[doc = "Temperature and humidity from hygrometer."]
17691#[doc = ""]
17692#[doc = "ID: 12920"]
17693#[derive(Debug, Clone, PartialEq)]
17694#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17695#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17696#[cfg_attr(feature = "ts", derive(TS))]
17697#[cfg_attr(feature = "ts", ts(export))]
17698pub struct HYGROMETER_SENSOR_DATA {
17699 #[doc = "Temperature"]
17700 pub temperature: i16,
17701 #[doc = "Humidity"]
17702 pub humidity: u16,
17703 #[doc = "Hygrometer ID"]
17704 pub id: u8,
17705}
17706impl HYGROMETER_SENSOR_DATA {
17707 pub const ENCODED_LEN: usize = 5usize;
17708 pub const DEFAULT: Self = Self {
17709 temperature: 0_i16,
17710 humidity: 0_u16,
17711 id: 0_u8,
17712 };
17713 #[cfg(feature = "arbitrary")]
17714 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17715 use arbitrary::{Arbitrary, Unstructured};
17716 let mut buf = [0u8; 1024];
17717 rng.fill_bytes(&mut buf);
17718 let mut unstructured = Unstructured::new(&buf);
17719 Self::arbitrary(&mut unstructured).unwrap_or_default()
17720 }
17721}
17722impl Default for HYGROMETER_SENSOR_DATA {
17723 fn default() -> Self {
17724 Self::DEFAULT.clone()
17725 }
17726}
17727impl MessageData for HYGROMETER_SENSOR_DATA {
17728 type Message = MavMessage;
17729 const ID: u32 = 12920u32;
17730 const NAME: &'static str = "HYGROMETER_SENSOR";
17731 const EXTRA_CRC: u8 = 20u8;
17732 const ENCODED_LEN: usize = 5usize;
17733 fn deser(
17734 _version: MavlinkVersion,
17735 __input: &[u8],
17736 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17737 let avail_len = __input.len();
17738 let mut payload_buf = [0; Self::ENCODED_LEN];
17739 let mut buf = if avail_len < Self::ENCODED_LEN {
17740 payload_buf[0..avail_len].copy_from_slice(__input);
17741 Bytes::new(&payload_buf)
17742 } else {
17743 Bytes::new(__input)
17744 };
17745 let mut __struct = Self::default();
17746 __struct.temperature = buf.get_i16_le()?;
17747 __struct.humidity = buf.get_u16_le()?;
17748 __struct.id = buf.get_u8()?;
17749 Ok(__struct)
17750 }
17751 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17752 let mut __tmp = BytesMut::new(bytes);
17753 #[allow(clippy::absurd_extreme_comparisons)]
17754 #[allow(unused_comparisons)]
17755 if __tmp.remaining() < Self::ENCODED_LEN {
17756 panic!(
17757 "buffer is too small (need {} bytes, but got {})",
17758 Self::ENCODED_LEN,
17759 __tmp.remaining(),
17760 )
17761 }
17762 __tmp.put_i16_le(self.temperature);
17763 __tmp.put_u16_le(self.humidity);
17764 __tmp.put_u8(self.id);
17765 if matches!(version, MavlinkVersion::V2) {
17766 let len = __tmp.len();
17767 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17768 } else {
17769 __tmp.len()
17770 }
17771 }
17772}
17773#[doc = "Illuminator status."]
17774#[doc = ""]
17775#[doc = "ID: 440"]
17776#[derive(Debug, Clone, PartialEq)]
17777#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17778#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17779#[cfg_attr(feature = "ts", derive(TS))]
17780#[cfg_attr(feature = "ts", ts(export))]
17781pub struct ILLUMINATOR_STATUS_DATA {
17782 #[doc = "Time since the start-up of the illuminator in ms"]
17783 pub uptime_ms: u32,
17784 #[doc = "Errors"]
17785 pub error_status: IlluminatorErrorFlags,
17786 #[doc = "Illuminator brightness"]
17787 pub brightness: f32,
17788 #[doc = "Illuminator strobing period in seconds"]
17789 pub strobe_period: f32,
17790 #[doc = "Illuminator strobing duty cycle"]
17791 pub strobe_duty_cycle: f32,
17792 #[doc = "Temperature in Celsius"]
17793 pub temp_c: f32,
17794 #[doc = "Minimum strobing period in seconds"]
17795 pub min_strobe_period: f32,
17796 #[doc = "Maximum strobing period in seconds"]
17797 pub max_strobe_period: f32,
17798 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
17799 pub enable: u8,
17800 #[doc = "Supported illuminator modes"]
17801 pub mode_bitmask: IlluminatorMode,
17802 #[doc = "Illuminator mode"]
17803 pub mode: IlluminatorMode,
17804}
17805impl ILLUMINATOR_STATUS_DATA {
17806 pub const ENCODED_LEN: usize = 35usize;
17807 pub const DEFAULT: Self = Self {
17808 uptime_ms: 0_u32,
17809 error_status: IlluminatorErrorFlags::DEFAULT,
17810 brightness: 0.0_f32,
17811 strobe_period: 0.0_f32,
17812 strobe_duty_cycle: 0.0_f32,
17813 temp_c: 0.0_f32,
17814 min_strobe_period: 0.0_f32,
17815 max_strobe_period: 0.0_f32,
17816 enable: 0_u8,
17817 mode_bitmask: IlluminatorMode::DEFAULT,
17818 mode: IlluminatorMode::DEFAULT,
17819 };
17820 #[cfg(feature = "arbitrary")]
17821 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17822 use arbitrary::{Arbitrary, Unstructured};
17823 let mut buf = [0u8; 1024];
17824 rng.fill_bytes(&mut buf);
17825 let mut unstructured = Unstructured::new(&buf);
17826 Self::arbitrary(&mut unstructured).unwrap_or_default()
17827 }
17828}
17829impl Default for ILLUMINATOR_STATUS_DATA {
17830 fn default() -> Self {
17831 Self::DEFAULT.clone()
17832 }
17833}
17834impl MessageData for ILLUMINATOR_STATUS_DATA {
17835 type Message = MavMessage;
17836 const ID: u32 = 440u32;
17837 const NAME: &'static str = "ILLUMINATOR_STATUS";
17838 const EXTRA_CRC: u8 = 66u8;
17839 const ENCODED_LEN: usize = 35usize;
17840 fn deser(
17841 _version: MavlinkVersion,
17842 __input: &[u8],
17843 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17844 let avail_len = __input.len();
17845 let mut payload_buf = [0; Self::ENCODED_LEN];
17846 let mut buf = if avail_len < Self::ENCODED_LEN {
17847 payload_buf[0..avail_len].copy_from_slice(__input);
17848 Bytes::new(&payload_buf)
17849 } else {
17850 Bytes::new(__input)
17851 };
17852 let mut __struct = Self::default();
17853 __struct.uptime_ms = buf.get_u32_le()?;
17854 let tmp = buf.get_u32_le()?;
17855 __struct.error_status = IlluminatorErrorFlags::from_bits(
17856 tmp as <IlluminatorErrorFlags as Flags>::Bits,
17857 )
17858 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17859 flag_type: "IlluminatorErrorFlags",
17860 value: tmp as u64,
17861 })?;
17862 __struct.brightness = buf.get_f32_le()?;
17863 __struct.strobe_period = buf.get_f32_le()?;
17864 __struct.strobe_duty_cycle = buf.get_f32_le()?;
17865 __struct.temp_c = buf.get_f32_le()?;
17866 __struct.min_strobe_period = buf.get_f32_le()?;
17867 __struct.max_strobe_period = buf.get_f32_le()?;
17868 __struct.enable = buf.get_u8()?;
17869 let tmp = buf.get_u8()?;
17870 __struct.mode_bitmask =
17871 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17872 enum_type: "IlluminatorMode",
17873 value: tmp as u64,
17874 })?;
17875 let tmp = buf.get_u8()?;
17876 __struct.mode =
17877 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17878 enum_type: "IlluminatorMode",
17879 value: tmp as u64,
17880 })?;
17881 Ok(__struct)
17882 }
17883 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17884 let mut __tmp = BytesMut::new(bytes);
17885 #[allow(clippy::absurd_extreme_comparisons)]
17886 #[allow(unused_comparisons)]
17887 if __tmp.remaining() < Self::ENCODED_LEN {
17888 panic!(
17889 "buffer is too small (need {} bytes, but got {})",
17890 Self::ENCODED_LEN,
17891 __tmp.remaining(),
17892 )
17893 }
17894 __tmp.put_u32_le(self.uptime_ms);
17895 __tmp.put_u32_le(self.error_status.bits() as u32);
17896 __tmp.put_f32_le(self.brightness);
17897 __tmp.put_f32_le(self.strobe_period);
17898 __tmp.put_f32_le(self.strobe_duty_cycle);
17899 __tmp.put_f32_le(self.temp_c);
17900 __tmp.put_f32_le(self.min_strobe_period);
17901 __tmp.put_f32_le(self.max_strobe_period);
17902 __tmp.put_u8(self.enable);
17903 __tmp.put_u8(self.mode_bitmask as u8);
17904 __tmp.put_u8(self.mode as u8);
17905 if matches!(version, MavlinkVersion::V2) {
17906 let len = __tmp.len();
17907 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17908 } else {
17909 __tmp.len()
17910 }
17911 }
17912}
17913#[doc = "Status of the Iridium SBD link."]
17914#[doc = ""]
17915#[doc = "ID: 335"]
17916#[derive(Debug, Clone, PartialEq)]
17917#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17918#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17919#[cfg_attr(feature = "ts", derive(TS))]
17920#[cfg_attr(feature = "ts", ts(export))]
17921pub struct ISBD_LINK_STATUS_DATA {
17922 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17923 pub timestamp: u64,
17924 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17925 pub last_heartbeat: u64,
17926 #[doc = "Number of failed SBD sessions."]
17927 pub failed_sessions: u16,
17928 #[doc = "Number of successful SBD sessions."]
17929 pub successful_sessions: u16,
17930 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
17931 pub signal_quality: u8,
17932 #[doc = "1: Ring call pending, 0: No call pending."]
17933 pub ring_pending: u8,
17934 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
17935 pub tx_session_pending: u8,
17936 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
17937 pub rx_session_pending: u8,
17938}
17939impl ISBD_LINK_STATUS_DATA {
17940 pub const ENCODED_LEN: usize = 24usize;
17941 pub const DEFAULT: Self = Self {
17942 timestamp: 0_u64,
17943 last_heartbeat: 0_u64,
17944 failed_sessions: 0_u16,
17945 successful_sessions: 0_u16,
17946 signal_quality: 0_u8,
17947 ring_pending: 0_u8,
17948 tx_session_pending: 0_u8,
17949 rx_session_pending: 0_u8,
17950 };
17951 #[cfg(feature = "arbitrary")]
17952 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17953 use arbitrary::{Arbitrary, Unstructured};
17954 let mut buf = [0u8; 1024];
17955 rng.fill_bytes(&mut buf);
17956 let mut unstructured = Unstructured::new(&buf);
17957 Self::arbitrary(&mut unstructured).unwrap_or_default()
17958 }
17959}
17960impl Default for ISBD_LINK_STATUS_DATA {
17961 fn default() -> Self {
17962 Self::DEFAULT.clone()
17963 }
17964}
17965impl MessageData for ISBD_LINK_STATUS_DATA {
17966 type Message = MavMessage;
17967 const ID: u32 = 335u32;
17968 const NAME: &'static str = "ISBD_LINK_STATUS";
17969 const EXTRA_CRC: u8 = 225u8;
17970 const ENCODED_LEN: usize = 24usize;
17971 fn deser(
17972 _version: MavlinkVersion,
17973 __input: &[u8],
17974 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17975 let avail_len = __input.len();
17976 let mut payload_buf = [0; Self::ENCODED_LEN];
17977 let mut buf = if avail_len < Self::ENCODED_LEN {
17978 payload_buf[0..avail_len].copy_from_slice(__input);
17979 Bytes::new(&payload_buf)
17980 } else {
17981 Bytes::new(__input)
17982 };
17983 let mut __struct = Self::default();
17984 __struct.timestamp = buf.get_u64_le()?;
17985 __struct.last_heartbeat = buf.get_u64_le()?;
17986 __struct.failed_sessions = buf.get_u16_le()?;
17987 __struct.successful_sessions = buf.get_u16_le()?;
17988 __struct.signal_quality = buf.get_u8()?;
17989 __struct.ring_pending = buf.get_u8()?;
17990 __struct.tx_session_pending = buf.get_u8()?;
17991 __struct.rx_session_pending = buf.get_u8()?;
17992 Ok(__struct)
17993 }
17994 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17995 let mut __tmp = BytesMut::new(bytes);
17996 #[allow(clippy::absurd_extreme_comparisons)]
17997 #[allow(unused_comparisons)]
17998 if __tmp.remaining() < Self::ENCODED_LEN {
17999 panic!(
18000 "buffer is too small (need {} bytes, but got {})",
18001 Self::ENCODED_LEN,
18002 __tmp.remaining(),
18003 )
18004 }
18005 __tmp.put_u64_le(self.timestamp);
18006 __tmp.put_u64_le(self.last_heartbeat);
18007 __tmp.put_u16_le(self.failed_sessions);
18008 __tmp.put_u16_le(self.successful_sessions);
18009 __tmp.put_u8(self.signal_quality);
18010 __tmp.put_u8(self.ring_pending);
18011 __tmp.put_u8(self.tx_session_pending);
18012 __tmp.put_u8(self.rx_session_pending);
18013 if matches!(version, MavlinkVersion::V2) {
18014 let len = __tmp.len();
18015 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18016 } else {
18017 __tmp.len()
18018 }
18019 }
18020}
18021#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
18022#[doc = ""]
18023#[doc = "ID: 149"]
18024#[derive(Debug, Clone, PartialEq)]
18025#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18026#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18027#[cfg_attr(feature = "ts", derive(TS))]
18028#[cfg_attr(feature = "ts", ts(export))]
18029pub struct LANDING_TARGET_DATA {
18030 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
18031 pub time_usec: u64,
18032 #[doc = "X-axis angular offset of the target from the center of the image"]
18033 pub angle_x: f32,
18034 #[doc = "Y-axis angular offset of the target from the center of the image"]
18035 pub angle_y: f32,
18036 #[doc = "Distance to the target from the vehicle"]
18037 pub distance: f32,
18038 #[doc = "Size of target along x-axis"]
18039 pub size_x: f32,
18040 #[doc = "Size of target along y-axis"]
18041 pub size_y: f32,
18042 #[doc = "The ID of the target if multiple targets are present"]
18043 pub target_num: u8,
18044 #[doc = "Coordinate frame used for following fields."]
18045 pub frame: MavFrame,
18046 #[doc = "X Position of the landing target in MAV_FRAME"]
18047 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18048 pub x: f32,
18049 #[doc = "Y Position of the landing target in MAV_FRAME"]
18050 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18051 pub y: f32,
18052 #[doc = "Z Position of the landing target in MAV_FRAME"]
18053 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18054 pub z: f32,
18055 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
18056 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18057 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18058 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18059 pub q: [f32; 4],
18060 #[doc = "Type of landing target"]
18061 #[cfg_attr(feature = "serde", serde(default))]
18062 pub mavtype: LandingTargetType,
18063 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
18064 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18065 pub position_valid: u8,
18066}
18067impl LANDING_TARGET_DATA {
18068 pub const ENCODED_LEN: usize = 60usize;
18069 pub const DEFAULT: Self = Self {
18070 time_usec: 0_u64,
18071 angle_x: 0.0_f32,
18072 angle_y: 0.0_f32,
18073 distance: 0.0_f32,
18074 size_x: 0.0_f32,
18075 size_y: 0.0_f32,
18076 target_num: 0_u8,
18077 frame: MavFrame::DEFAULT,
18078 x: 0.0_f32,
18079 y: 0.0_f32,
18080 z: 0.0_f32,
18081 q: [0.0_f32; 4usize],
18082 mavtype: LandingTargetType::DEFAULT,
18083 position_valid: 0_u8,
18084 };
18085 #[cfg(feature = "arbitrary")]
18086 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18087 use arbitrary::{Arbitrary, Unstructured};
18088 let mut buf = [0u8; 1024];
18089 rng.fill_bytes(&mut buf);
18090 let mut unstructured = Unstructured::new(&buf);
18091 Self::arbitrary(&mut unstructured).unwrap_or_default()
18092 }
18093}
18094impl Default for LANDING_TARGET_DATA {
18095 fn default() -> Self {
18096 Self::DEFAULT.clone()
18097 }
18098}
18099impl MessageData for LANDING_TARGET_DATA {
18100 type Message = MavMessage;
18101 const ID: u32 = 149u32;
18102 const NAME: &'static str = "LANDING_TARGET";
18103 const EXTRA_CRC: u8 = 200u8;
18104 const ENCODED_LEN: usize = 60usize;
18105 fn deser(
18106 _version: MavlinkVersion,
18107 __input: &[u8],
18108 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18109 let avail_len = __input.len();
18110 let mut payload_buf = [0; Self::ENCODED_LEN];
18111 let mut buf = if avail_len < Self::ENCODED_LEN {
18112 payload_buf[0..avail_len].copy_from_slice(__input);
18113 Bytes::new(&payload_buf)
18114 } else {
18115 Bytes::new(__input)
18116 };
18117 let mut __struct = Self::default();
18118 __struct.time_usec = buf.get_u64_le()?;
18119 __struct.angle_x = buf.get_f32_le()?;
18120 __struct.angle_y = buf.get_f32_le()?;
18121 __struct.distance = buf.get_f32_le()?;
18122 __struct.size_x = buf.get_f32_le()?;
18123 __struct.size_y = buf.get_f32_le()?;
18124 __struct.target_num = buf.get_u8()?;
18125 let tmp = buf.get_u8()?;
18126 __struct.frame =
18127 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18128 enum_type: "MavFrame",
18129 value: tmp as u64,
18130 })?;
18131 __struct.x = buf.get_f32_le()?;
18132 __struct.y = buf.get_f32_le()?;
18133 __struct.z = buf.get_f32_le()?;
18134 for v in &mut __struct.q {
18135 let val = buf.get_f32_le()?;
18136 *v = val;
18137 }
18138 let tmp = buf.get_u8()?;
18139 __struct.mavtype =
18140 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18141 enum_type: "LandingTargetType",
18142 value: tmp as u64,
18143 })?;
18144 __struct.position_valid = buf.get_u8()?;
18145 Ok(__struct)
18146 }
18147 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18148 let mut __tmp = BytesMut::new(bytes);
18149 #[allow(clippy::absurd_extreme_comparisons)]
18150 #[allow(unused_comparisons)]
18151 if __tmp.remaining() < Self::ENCODED_LEN {
18152 panic!(
18153 "buffer is too small (need {} bytes, but got {})",
18154 Self::ENCODED_LEN,
18155 __tmp.remaining(),
18156 )
18157 }
18158 __tmp.put_u64_le(self.time_usec);
18159 __tmp.put_f32_le(self.angle_x);
18160 __tmp.put_f32_le(self.angle_y);
18161 __tmp.put_f32_le(self.distance);
18162 __tmp.put_f32_le(self.size_x);
18163 __tmp.put_f32_le(self.size_y);
18164 __tmp.put_u8(self.target_num);
18165 __tmp.put_u8(self.frame as u8);
18166 if matches!(version, MavlinkVersion::V2) {
18167 __tmp.put_f32_le(self.x);
18168 __tmp.put_f32_le(self.y);
18169 __tmp.put_f32_le(self.z);
18170 for val in &self.q {
18171 __tmp.put_f32_le(*val);
18172 }
18173 __tmp.put_u8(self.mavtype as u8);
18174 __tmp.put_u8(self.position_valid);
18175 let len = __tmp.len();
18176 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18177 } else {
18178 __tmp.len()
18179 }
18180 }
18181}
18182#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
18183#[doc = ""]
18184#[doc = "ID: 8"]
18185#[derive(Debug, Clone, PartialEq)]
18186#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18187#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18188#[cfg_attr(feature = "ts", derive(TS))]
18189#[cfg_attr(feature = "ts", ts(export))]
18190pub struct LINK_NODE_STATUS_DATA {
18191 #[doc = "Timestamp (time since system boot)."]
18192 pub timestamp: u64,
18193 #[doc = "Transmit rate"]
18194 pub tx_rate: u32,
18195 #[doc = "Receive rate"]
18196 pub rx_rate: u32,
18197 #[doc = "Messages sent"]
18198 pub messages_sent: u32,
18199 #[doc = "Messages received (estimated from counting seq)"]
18200 pub messages_received: u32,
18201 #[doc = "Messages lost (estimated from counting seq)"]
18202 pub messages_lost: u32,
18203 #[doc = "Number of bytes that could not be parsed correctly."]
18204 pub rx_parse_err: u16,
18205 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
18206 pub tx_overflows: u16,
18207 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
18208 pub rx_overflows: u16,
18209 #[doc = "Remaining free transmit buffer space"]
18210 pub tx_buf: u8,
18211 #[doc = "Remaining free receive buffer space"]
18212 pub rx_buf: u8,
18213}
18214impl LINK_NODE_STATUS_DATA {
18215 pub const ENCODED_LEN: usize = 36usize;
18216 pub const DEFAULT: Self = Self {
18217 timestamp: 0_u64,
18218 tx_rate: 0_u32,
18219 rx_rate: 0_u32,
18220 messages_sent: 0_u32,
18221 messages_received: 0_u32,
18222 messages_lost: 0_u32,
18223 rx_parse_err: 0_u16,
18224 tx_overflows: 0_u16,
18225 rx_overflows: 0_u16,
18226 tx_buf: 0_u8,
18227 rx_buf: 0_u8,
18228 };
18229 #[cfg(feature = "arbitrary")]
18230 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18231 use arbitrary::{Arbitrary, Unstructured};
18232 let mut buf = [0u8; 1024];
18233 rng.fill_bytes(&mut buf);
18234 let mut unstructured = Unstructured::new(&buf);
18235 Self::arbitrary(&mut unstructured).unwrap_or_default()
18236 }
18237}
18238impl Default for LINK_NODE_STATUS_DATA {
18239 fn default() -> Self {
18240 Self::DEFAULT.clone()
18241 }
18242}
18243impl MessageData for LINK_NODE_STATUS_DATA {
18244 type Message = MavMessage;
18245 const ID: u32 = 8u32;
18246 const NAME: &'static str = "LINK_NODE_STATUS";
18247 const EXTRA_CRC: u8 = 117u8;
18248 const ENCODED_LEN: usize = 36usize;
18249 fn deser(
18250 _version: MavlinkVersion,
18251 __input: &[u8],
18252 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18253 let avail_len = __input.len();
18254 let mut payload_buf = [0; Self::ENCODED_LEN];
18255 let mut buf = if avail_len < Self::ENCODED_LEN {
18256 payload_buf[0..avail_len].copy_from_slice(__input);
18257 Bytes::new(&payload_buf)
18258 } else {
18259 Bytes::new(__input)
18260 };
18261 let mut __struct = Self::default();
18262 __struct.timestamp = buf.get_u64_le()?;
18263 __struct.tx_rate = buf.get_u32_le()?;
18264 __struct.rx_rate = buf.get_u32_le()?;
18265 __struct.messages_sent = buf.get_u32_le()?;
18266 __struct.messages_received = buf.get_u32_le()?;
18267 __struct.messages_lost = buf.get_u32_le()?;
18268 __struct.rx_parse_err = buf.get_u16_le()?;
18269 __struct.tx_overflows = buf.get_u16_le()?;
18270 __struct.rx_overflows = buf.get_u16_le()?;
18271 __struct.tx_buf = buf.get_u8()?;
18272 __struct.rx_buf = buf.get_u8()?;
18273 Ok(__struct)
18274 }
18275 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18276 let mut __tmp = BytesMut::new(bytes);
18277 #[allow(clippy::absurd_extreme_comparisons)]
18278 #[allow(unused_comparisons)]
18279 if __tmp.remaining() < Self::ENCODED_LEN {
18280 panic!(
18281 "buffer is too small (need {} bytes, but got {})",
18282 Self::ENCODED_LEN,
18283 __tmp.remaining(),
18284 )
18285 }
18286 __tmp.put_u64_le(self.timestamp);
18287 __tmp.put_u32_le(self.tx_rate);
18288 __tmp.put_u32_le(self.rx_rate);
18289 __tmp.put_u32_le(self.messages_sent);
18290 __tmp.put_u32_le(self.messages_received);
18291 __tmp.put_u32_le(self.messages_lost);
18292 __tmp.put_u16_le(self.rx_parse_err);
18293 __tmp.put_u16_le(self.tx_overflows);
18294 __tmp.put_u16_le(self.rx_overflows);
18295 __tmp.put_u8(self.tx_buf);
18296 __tmp.put_u8(self.rx_buf);
18297 if matches!(version, MavlinkVersion::V2) {
18298 let len = __tmp.len();
18299 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18300 } else {
18301 __tmp.len()
18302 }
18303 }
18304}
18305#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
18306#[doc = ""]
18307#[doc = "ID: 32"]
18308#[derive(Debug, Clone, PartialEq)]
18309#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18310#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18311#[cfg_attr(feature = "ts", derive(TS))]
18312#[cfg_attr(feature = "ts", ts(export))]
18313pub struct LOCAL_POSITION_NED_DATA {
18314 #[doc = "Timestamp (time since system boot)."]
18315 pub time_boot_ms: u32,
18316 #[doc = "X Position"]
18317 pub x: f32,
18318 #[doc = "Y Position"]
18319 pub y: f32,
18320 #[doc = "Z Position"]
18321 pub z: f32,
18322 #[doc = "X Speed"]
18323 pub vx: f32,
18324 #[doc = "Y Speed"]
18325 pub vy: f32,
18326 #[doc = "Z Speed"]
18327 pub vz: f32,
18328}
18329impl LOCAL_POSITION_NED_DATA {
18330 pub const ENCODED_LEN: usize = 28usize;
18331 pub const DEFAULT: Self = Self {
18332 time_boot_ms: 0_u32,
18333 x: 0.0_f32,
18334 y: 0.0_f32,
18335 z: 0.0_f32,
18336 vx: 0.0_f32,
18337 vy: 0.0_f32,
18338 vz: 0.0_f32,
18339 };
18340 #[cfg(feature = "arbitrary")]
18341 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18342 use arbitrary::{Arbitrary, Unstructured};
18343 let mut buf = [0u8; 1024];
18344 rng.fill_bytes(&mut buf);
18345 let mut unstructured = Unstructured::new(&buf);
18346 Self::arbitrary(&mut unstructured).unwrap_or_default()
18347 }
18348}
18349impl Default for LOCAL_POSITION_NED_DATA {
18350 fn default() -> Self {
18351 Self::DEFAULT.clone()
18352 }
18353}
18354impl MessageData for LOCAL_POSITION_NED_DATA {
18355 type Message = MavMessage;
18356 const ID: u32 = 32u32;
18357 const NAME: &'static str = "LOCAL_POSITION_NED";
18358 const EXTRA_CRC: u8 = 185u8;
18359 const ENCODED_LEN: usize = 28usize;
18360 fn deser(
18361 _version: MavlinkVersion,
18362 __input: &[u8],
18363 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18364 let avail_len = __input.len();
18365 let mut payload_buf = [0; Self::ENCODED_LEN];
18366 let mut buf = if avail_len < Self::ENCODED_LEN {
18367 payload_buf[0..avail_len].copy_from_slice(__input);
18368 Bytes::new(&payload_buf)
18369 } else {
18370 Bytes::new(__input)
18371 };
18372 let mut __struct = Self::default();
18373 __struct.time_boot_ms = buf.get_u32_le()?;
18374 __struct.x = buf.get_f32_le()?;
18375 __struct.y = buf.get_f32_le()?;
18376 __struct.z = buf.get_f32_le()?;
18377 __struct.vx = buf.get_f32_le()?;
18378 __struct.vy = buf.get_f32_le()?;
18379 __struct.vz = buf.get_f32_le()?;
18380 Ok(__struct)
18381 }
18382 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18383 let mut __tmp = BytesMut::new(bytes);
18384 #[allow(clippy::absurd_extreme_comparisons)]
18385 #[allow(unused_comparisons)]
18386 if __tmp.remaining() < Self::ENCODED_LEN {
18387 panic!(
18388 "buffer is too small (need {} bytes, but got {})",
18389 Self::ENCODED_LEN,
18390 __tmp.remaining(),
18391 )
18392 }
18393 __tmp.put_u32_le(self.time_boot_ms);
18394 __tmp.put_f32_le(self.x);
18395 __tmp.put_f32_le(self.y);
18396 __tmp.put_f32_le(self.z);
18397 __tmp.put_f32_le(self.vx);
18398 __tmp.put_f32_le(self.vy);
18399 __tmp.put_f32_le(self.vz);
18400 if matches!(version, MavlinkVersion::V2) {
18401 let len = __tmp.len();
18402 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18403 } else {
18404 __tmp.len()
18405 }
18406 }
18407}
18408#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
18409#[doc = ""]
18410#[doc = "ID: 64"]
18411#[derive(Debug, Clone, PartialEq)]
18412#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18413#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18414#[cfg_attr(feature = "ts", derive(TS))]
18415#[cfg_attr(feature = "ts", ts(export))]
18416pub struct LOCAL_POSITION_NED_COV_DATA {
18417 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
18418 pub time_usec: u64,
18419 #[doc = "X Position"]
18420 pub x: f32,
18421 #[doc = "Y Position"]
18422 pub y: f32,
18423 #[doc = "Z Position"]
18424 pub z: f32,
18425 #[doc = "X Speed"]
18426 pub vx: f32,
18427 #[doc = "Y Speed"]
18428 pub vy: f32,
18429 #[doc = "Z Speed"]
18430 pub vz: f32,
18431 #[doc = "X Acceleration"]
18432 pub ax: f32,
18433 #[doc = "Y Acceleration"]
18434 pub ay: f32,
18435 #[doc = "Z Acceleration"]
18436 pub az: f32,
18437 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
18438 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18439 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18440 pub covariance: [f32; 45],
18441 #[doc = "Class id of the estimator this estimate originated from."]
18442 pub estimator_type: MavEstimatorType,
18443}
18444impl LOCAL_POSITION_NED_COV_DATA {
18445 pub const ENCODED_LEN: usize = 225usize;
18446 pub const DEFAULT: Self = Self {
18447 time_usec: 0_u64,
18448 x: 0.0_f32,
18449 y: 0.0_f32,
18450 z: 0.0_f32,
18451 vx: 0.0_f32,
18452 vy: 0.0_f32,
18453 vz: 0.0_f32,
18454 ax: 0.0_f32,
18455 ay: 0.0_f32,
18456 az: 0.0_f32,
18457 covariance: [0.0_f32; 45usize],
18458 estimator_type: MavEstimatorType::DEFAULT,
18459 };
18460 #[cfg(feature = "arbitrary")]
18461 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18462 use arbitrary::{Arbitrary, Unstructured};
18463 let mut buf = [0u8; 1024];
18464 rng.fill_bytes(&mut buf);
18465 let mut unstructured = Unstructured::new(&buf);
18466 Self::arbitrary(&mut unstructured).unwrap_or_default()
18467 }
18468}
18469impl Default for LOCAL_POSITION_NED_COV_DATA {
18470 fn default() -> Self {
18471 Self::DEFAULT.clone()
18472 }
18473}
18474impl MessageData for LOCAL_POSITION_NED_COV_DATA {
18475 type Message = MavMessage;
18476 const ID: u32 = 64u32;
18477 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
18478 const EXTRA_CRC: u8 = 191u8;
18479 const ENCODED_LEN: usize = 225usize;
18480 fn deser(
18481 _version: MavlinkVersion,
18482 __input: &[u8],
18483 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18484 let avail_len = __input.len();
18485 let mut payload_buf = [0; Self::ENCODED_LEN];
18486 let mut buf = if avail_len < Self::ENCODED_LEN {
18487 payload_buf[0..avail_len].copy_from_slice(__input);
18488 Bytes::new(&payload_buf)
18489 } else {
18490 Bytes::new(__input)
18491 };
18492 let mut __struct = Self::default();
18493 __struct.time_usec = buf.get_u64_le()?;
18494 __struct.x = buf.get_f32_le()?;
18495 __struct.y = buf.get_f32_le()?;
18496 __struct.z = buf.get_f32_le()?;
18497 __struct.vx = buf.get_f32_le()?;
18498 __struct.vy = buf.get_f32_le()?;
18499 __struct.vz = buf.get_f32_le()?;
18500 __struct.ax = buf.get_f32_le()?;
18501 __struct.ay = buf.get_f32_le()?;
18502 __struct.az = buf.get_f32_le()?;
18503 for v in &mut __struct.covariance {
18504 let val = buf.get_f32_le()?;
18505 *v = val;
18506 }
18507 let tmp = buf.get_u8()?;
18508 __struct.estimator_type =
18509 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18510 enum_type: "MavEstimatorType",
18511 value: tmp as u64,
18512 })?;
18513 Ok(__struct)
18514 }
18515 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18516 let mut __tmp = BytesMut::new(bytes);
18517 #[allow(clippy::absurd_extreme_comparisons)]
18518 #[allow(unused_comparisons)]
18519 if __tmp.remaining() < Self::ENCODED_LEN {
18520 panic!(
18521 "buffer is too small (need {} bytes, but got {})",
18522 Self::ENCODED_LEN,
18523 __tmp.remaining(),
18524 )
18525 }
18526 __tmp.put_u64_le(self.time_usec);
18527 __tmp.put_f32_le(self.x);
18528 __tmp.put_f32_le(self.y);
18529 __tmp.put_f32_le(self.z);
18530 __tmp.put_f32_le(self.vx);
18531 __tmp.put_f32_le(self.vy);
18532 __tmp.put_f32_le(self.vz);
18533 __tmp.put_f32_le(self.ax);
18534 __tmp.put_f32_le(self.ay);
18535 __tmp.put_f32_le(self.az);
18536 for val in &self.covariance {
18537 __tmp.put_f32_le(*val);
18538 }
18539 __tmp.put_u8(self.estimator_type as u8);
18540 if matches!(version, MavlinkVersion::V2) {
18541 let len = __tmp.len();
18542 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18543 } else {
18544 __tmp.len()
18545 }
18546 }
18547}
18548#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
18549#[doc = ""]
18550#[doc = "ID: 89"]
18551#[derive(Debug, Clone, PartialEq)]
18552#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18553#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18554#[cfg_attr(feature = "ts", derive(TS))]
18555#[cfg_attr(feature = "ts", ts(export))]
18556pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18557 #[doc = "Timestamp (time since system boot)."]
18558 pub time_boot_ms: u32,
18559 #[doc = "X Position"]
18560 pub x: f32,
18561 #[doc = "Y Position"]
18562 pub y: f32,
18563 #[doc = "Z Position"]
18564 pub z: f32,
18565 #[doc = "Roll"]
18566 pub roll: f32,
18567 #[doc = "Pitch"]
18568 pub pitch: f32,
18569 #[doc = "Yaw"]
18570 pub yaw: f32,
18571}
18572impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18573 pub const ENCODED_LEN: usize = 28usize;
18574 pub const DEFAULT: Self = Self {
18575 time_boot_ms: 0_u32,
18576 x: 0.0_f32,
18577 y: 0.0_f32,
18578 z: 0.0_f32,
18579 roll: 0.0_f32,
18580 pitch: 0.0_f32,
18581 yaw: 0.0_f32,
18582 };
18583 #[cfg(feature = "arbitrary")]
18584 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18585 use arbitrary::{Arbitrary, Unstructured};
18586 let mut buf = [0u8; 1024];
18587 rng.fill_bytes(&mut buf);
18588 let mut unstructured = Unstructured::new(&buf);
18589 Self::arbitrary(&mut unstructured).unwrap_or_default()
18590 }
18591}
18592impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18593 fn default() -> Self {
18594 Self::DEFAULT.clone()
18595 }
18596}
18597impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18598 type Message = MavMessage;
18599 const ID: u32 = 89u32;
18600 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
18601 const EXTRA_CRC: u8 = 231u8;
18602 const ENCODED_LEN: usize = 28usize;
18603 fn deser(
18604 _version: MavlinkVersion,
18605 __input: &[u8],
18606 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18607 let avail_len = __input.len();
18608 let mut payload_buf = [0; Self::ENCODED_LEN];
18609 let mut buf = if avail_len < Self::ENCODED_LEN {
18610 payload_buf[0..avail_len].copy_from_slice(__input);
18611 Bytes::new(&payload_buf)
18612 } else {
18613 Bytes::new(__input)
18614 };
18615 let mut __struct = Self::default();
18616 __struct.time_boot_ms = buf.get_u32_le()?;
18617 __struct.x = buf.get_f32_le()?;
18618 __struct.y = buf.get_f32_le()?;
18619 __struct.z = buf.get_f32_le()?;
18620 __struct.roll = buf.get_f32_le()?;
18621 __struct.pitch = buf.get_f32_le()?;
18622 __struct.yaw = buf.get_f32_le()?;
18623 Ok(__struct)
18624 }
18625 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18626 let mut __tmp = BytesMut::new(bytes);
18627 #[allow(clippy::absurd_extreme_comparisons)]
18628 #[allow(unused_comparisons)]
18629 if __tmp.remaining() < Self::ENCODED_LEN {
18630 panic!(
18631 "buffer is too small (need {} bytes, but got {})",
18632 Self::ENCODED_LEN,
18633 __tmp.remaining(),
18634 )
18635 }
18636 __tmp.put_u32_le(self.time_boot_ms);
18637 __tmp.put_f32_le(self.x);
18638 __tmp.put_f32_le(self.y);
18639 __tmp.put_f32_le(self.z);
18640 __tmp.put_f32_le(self.roll);
18641 __tmp.put_f32_le(self.pitch);
18642 __tmp.put_f32_le(self.yaw);
18643 if matches!(version, MavlinkVersion::V2) {
18644 let len = __tmp.len();
18645 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18646 } else {
18647 __tmp.len()
18648 }
18649 }
18650}
18651#[doc = "An ack for a LOGGING_DATA_ACKED message."]
18652#[doc = ""]
18653#[doc = "ID: 268"]
18654#[derive(Debug, Clone, PartialEq)]
18655#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18656#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18657#[cfg_attr(feature = "ts", derive(TS))]
18658#[cfg_attr(feature = "ts", ts(export))]
18659pub struct LOGGING_ACK_DATA {
18660 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
18661 pub sequence: u16,
18662 #[doc = "system ID of the target"]
18663 pub target_system: u8,
18664 #[doc = "component ID of the target"]
18665 pub target_component: u8,
18666}
18667impl LOGGING_ACK_DATA {
18668 pub const ENCODED_LEN: usize = 4usize;
18669 pub const DEFAULT: Self = Self {
18670 sequence: 0_u16,
18671 target_system: 0_u8,
18672 target_component: 0_u8,
18673 };
18674 #[cfg(feature = "arbitrary")]
18675 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18676 use arbitrary::{Arbitrary, Unstructured};
18677 let mut buf = [0u8; 1024];
18678 rng.fill_bytes(&mut buf);
18679 let mut unstructured = Unstructured::new(&buf);
18680 Self::arbitrary(&mut unstructured).unwrap_or_default()
18681 }
18682}
18683impl Default for LOGGING_ACK_DATA {
18684 fn default() -> Self {
18685 Self::DEFAULT.clone()
18686 }
18687}
18688impl MessageData for LOGGING_ACK_DATA {
18689 type Message = MavMessage;
18690 const ID: u32 = 268u32;
18691 const NAME: &'static str = "LOGGING_ACK";
18692 const EXTRA_CRC: u8 = 14u8;
18693 const ENCODED_LEN: usize = 4usize;
18694 fn deser(
18695 _version: MavlinkVersion,
18696 __input: &[u8],
18697 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18698 let avail_len = __input.len();
18699 let mut payload_buf = [0; Self::ENCODED_LEN];
18700 let mut buf = if avail_len < Self::ENCODED_LEN {
18701 payload_buf[0..avail_len].copy_from_slice(__input);
18702 Bytes::new(&payload_buf)
18703 } else {
18704 Bytes::new(__input)
18705 };
18706 let mut __struct = Self::default();
18707 __struct.sequence = buf.get_u16_le()?;
18708 __struct.target_system = buf.get_u8()?;
18709 __struct.target_component = buf.get_u8()?;
18710 Ok(__struct)
18711 }
18712 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18713 let mut __tmp = BytesMut::new(bytes);
18714 #[allow(clippy::absurd_extreme_comparisons)]
18715 #[allow(unused_comparisons)]
18716 if __tmp.remaining() < Self::ENCODED_LEN {
18717 panic!(
18718 "buffer is too small (need {} bytes, but got {})",
18719 Self::ENCODED_LEN,
18720 __tmp.remaining(),
18721 )
18722 }
18723 __tmp.put_u16_le(self.sequence);
18724 __tmp.put_u8(self.target_system);
18725 __tmp.put_u8(self.target_component);
18726 if matches!(version, MavlinkVersion::V2) {
18727 let len = __tmp.len();
18728 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18729 } else {
18730 __tmp.len()
18731 }
18732 }
18733}
18734#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
18735#[doc = ""]
18736#[doc = "ID: 266"]
18737#[derive(Debug, Clone, PartialEq)]
18738#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18739#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18740#[cfg_attr(feature = "ts", derive(TS))]
18741#[cfg_attr(feature = "ts", ts(export))]
18742pub struct LOGGING_DATA_DATA {
18743 #[doc = "sequence number (can wrap)"]
18744 pub sequence: u16,
18745 #[doc = "system ID of the target"]
18746 pub target_system: u8,
18747 #[doc = "component ID of the target"]
18748 pub target_component: u8,
18749 #[doc = "data length"]
18750 pub length: u8,
18751 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18752 pub first_message_offset: u8,
18753 #[doc = "logged data"]
18754 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18755 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18756 pub data: [u8; 249],
18757}
18758impl LOGGING_DATA_DATA {
18759 pub const ENCODED_LEN: usize = 255usize;
18760 pub const DEFAULT: Self = Self {
18761 sequence: 0_u16,
18762 target_system: 0_u8,
18763 target_component: 0_u8,
18764 length: 0_u8,
18765 first_message_offset: 0_u8,
18766 data: [0_u8; 249usize],
18767 };
18768 #[cfg(feature = "arbitrary")]
18769 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18770 use arbitrary::{Arbitrary, Unstructured};
18771 let mut buf = [0u8; 1024];
18772 rng.fill_bytes(&mut buf);
18773 let mut unstructured = Unstructured::new(&buf);
18774 Self::arbitrary(&mut unstructured).unwrap_or_default()
18775 }
18776}
18777impl Default for LOGGING_DATA_DATA {
18778 fn default() -> Self {
18779 Self::DEFAULT.clone()
18780 }
18781}
18782impl MessageData for LOGGING_DATA_DATA {
18783 type Message = MavMessage;
18784 const ID: u32 = 266u32;
18785 const NAME: &'static str = "LOGGING_DATA";
18786 const EXTRA_CRC: u8 = 193u8;
18787 const ENCODED_LEN: usize = 255usize;
18788 fn deser(
18789 _version: MavlinkVersion,
18790 __input: &[u8],
18791 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18792 let avail_len = __input.len();
18793 let mut payload_buf = [0; Self::ENCODED_LEN];
18794 let mut buf = if avail_len < Self::ENCODED_LEN {
18795 payload_buf[0..avail_len].copy_from_slice(__input);
18796 Bytes::new(&payload_buf)
18797 } else {
18798 Bytes::new(__input)
18799 };
18800 let mut __struct = Self::default();
18801 __struct.sequence = buf.get_u16_le()?;
18802 __struct.target_system = buf.get_u8()?;
18803 __struct.target_component = buf.get_u8()?;
18804 __struct.length = buf.get_u8()?;
18805 __struct.first_message_offset = buf.get_u8()?;
18806 for v in &mut __struct.data {
18807 let val = buf.get_u8()?;
18808 *v = val;
18809 }
18810 Ok(__struct)
18811 }
18812 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18813 let mut __tmp = BytesMut::new(bytes);
18814 #[allow(clippy::absurd_extreme_comparisons)]
18815 #[allow(unused_comparisons)]
18816 if __tmp.remaining() < Self::ENCODED_LEN {
18817 panic!(
18818 "buffer is too small (need {} bytes, but got {})",
18819 Self::ENCODED_LEN,
18820 __tmp.remaining(),
18821 )
18822 }
18823 __tmp.put_u16_le(self.sequence);
18824 __tmp.put_u8(self.target_system);
18825 __tmp.put_u8(self.target_component);
18826 __tmp.put_u8(self.length);
18827 __tmp.put_u8(self.first_message_offset);
18828 for val in &self.data {
18829 __tmp.put_u8(*val);
18830 }
18831 if matches!(version, MavlinkVersion::V2) {
18832 let len = __tmp.len();
18833 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18834 } else {
18835 __tmp.len()
18836 }
18837 }
18838}
18839#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
18840#[doc = ""]
18841#[doc = "ID: 267"]
18842#[derive(Debug, Clone, PartialEq)]
18843#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18844#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18845#[cfg_attr(feature = "ts", derive(TS))]
18846#[cfg_attr(feature = "ts", ts(export))]
18847pub struct LOGGING_DATA_ACKED_DATA {
18848 #[doc = "sequence number (can wrap)"]
18849 pub sequence: u16,
18850 #[doc = "system ID of the target"]
18851 pub target_system: u8,
18852 #[doc = "component ID of the target"]
18853 pub target_component: u8,
18854 #[doc = "data length"]
18855 pub length: u8,
18856 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18857 pub first_message_offset: u8,
18858 #[doc = "logged data"]
18859 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18860 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18861 pub data: [u8; 249],
18862}
18863impl LOGGING_DATA_ACKED_DATA {
18864 pub const ENCODED_LEN: usize = 255usize;
18865 pub const DEFAULT: Self = Self {
18866 sequence: 0_u16,
18867 target_system: 0_u8,
18868 target_component: 0_u8,
18869 length: 0_u8,
18870 first_message_offset: 0_u8,
18871 data: [0_u8; 249usize],
18872 };
18873 #[cfg(feature = "arbitrary")]
18874 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18875 use arbitrary::{Arbitrary, Unstructured};
18876 let mut buf = [0u8; 1024];
18877 rng.fill_bytes(&mut buf);
18878 let mut unstructured = Unstructured::new(&buf);
18879 Self::arbitrary(&mut unstructured).unwrap_or_default()
18880 }
18881}
18882impl Default for LOGGING_DATA_ACKED_DATA {
18883 fn default() -> Self {
18884 Self::DEFAULT.clone()
18885 }
18886}
18887impl MessageData for LOGGING_DATA_ACKED_DATA {
18888 type Message = MavMessage;
18889 const ID: u32 = 267u32;
18890 const NAME: &'static str = "LOGGING_DATA_ACKED";
18891 const EXTRA_CRC: u8 = 35u8;
18892 const ENCODED_LEN: usize = 255usize;
18893 fn deser(
18894 _version: MavlinkVersion,
18895 __input: &[u8],
18896 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18897 let avail_len = __input.len();
18898 let mut payload_buf = [0; Self::ENCODED_LEN];
18899 let mut buf = if avail_len < Self::ENCODED_LEN {
18900 payload_buf[0..avail_len].copy_from_slice(__input);
18901 Bytes::new(&payload_buf)
18902 } else {
18903 Bytes::new(__input)
18904 };
18905 let mut __struct = Self::default();
18906 __struct.sequence = buf.get_u16_le()?;
18907 __struct.target_system = buf.get_u8()?;
18908 __struct.target_component = buf.get_u8()?;
18909 __struct.length = buf.get_u8()?;
18910 __struct.first_message_offset = buf.get_u8()?;
18911 for v in &mut __struct.data {
18912 let val = buf.get_u8()?;
18913 *v = val;
18914 }
18915 Ok(__struct)
18916 }
18917 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18918 let mut __tmp = BytesMut::new(bytes);
18919 #[allow(clippy::absurd_extreme_comparisons)]
18920 #[allow(unused_comparisons)]
18921 if __tmp.remaining() < Self::ENCODED_LEN {
18922 panic!(
18923 "buffer is too small (need {} bytes, but got {})",
18924 Self::ENCODED_LEN,
18925 __tmp.remaining(),
18926 )
18927 }
18928 __tmp.put_u16_le(self.sequence);
18929 __tmp.put_u8(self.target_system);
18930 __tmp.put_u8(self.target_component);
18931 __tmp.put_u8(self.length);
18932 __tmp.put_u8(self.first_message_offset);
18933 for val in &self.data {
18934 __tmp.put_u8(*val);
18935 }
18936 if matches!(version, MavlinkVersion::V2) {
18937 let len = __tmp.len();
18938 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18939 } else {
18940 __tmp.len()
18941 }
18942 }
18943}
18944#[doc = "Reply to LOG_REQUEST_DATA."]
18945#[doc = ""]
18946#[doc = "ID: 120"]
18947#[derive(Debug, Clone, PartialEq)]
18948#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18949#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18950#[cfg_attr(feature = "ts", derive(TS))]
18951#[cfg_attr(feature = "ts", ts(export))]
18952pub struct LOG_DATA_DATA {
18953 #[doc = "Offset into the log"]
18954 pub ofs: u32,
18955 #[doc = "Log id (from LOG_ENTRY reply)"]
18956 pub id: u16,
18957 #[doc = "Number of bytes (zero for end of log)"]
18958 pub count: u8,
18959 #[doc = "log data"]
18960 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18961 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18962 pub data: [u8; 90],
18963}
18964impl LOG_DATA_DATA {
18965 pub const ENCODED_LEN: usize = 97usize;
18966 pub const DEFAULT: Self = Self {
18967 ofs: 0_u32,
18968 id: 0_u16,
18969 count: 0_u8,
18970 data: [0_u8; 90usize],
18971 };
18972 #[cfg(feature = "arbitrary")]
18973 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18974 use arbitrary::{Arbitrary, Unstructured};
18975 let mut buf = [0u8; 1024];
18976 rng.fill_bytes(&mut buf);
18977 let mut unstructured = Unstructured::new(&buf);
18978 Self::arbitrary(&mut unstructured).unwrap_or_default()
18979 }
18980}
18981impl Default for LOG_DATA_DATA {
18982 fn default() -> Self {
18983 Self::DEFAULT.clone()
18984 }
18985}
18986impl MessageData for LOG_DATA_DATA {
18987 type Message = MavMessage;
18988 const ID: u32 = 120u32;
18989 const NAME: &'static str = "LOG_DATA";
18990 const EXTRA_CRC: u8 = 134u8;
18991 const ENCODED_LEN: usize = 97usize;
18992 fn deser(
18993 _version: MavlinkVersion,
18994 __input: &[u8],
18995 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18996 let avail_len = __input.len();
18997 let mut payload_buf = [0; Self::ENCODED_LEN];
18998 let mut buf = if avail_len < Self::ENCODED_LEN {
18999 payload_buf[0..avail_len].copy_from_slice(__input);
19000 Bytes::new(&payload_buf)
19001 } else {
19002 Bytes::new(__input)
19003 };
19004 let mut __struct = Self::default();
19005 __struct.ofs = buf.get_u32_le()?;
19006 __struct.id = buf.get_u16_le()?;
19007 __struct.count = buf.get_u8()?;
19008 for v in &mut __struct.data {
19009 let val = buf.get_u8()?;
19010 *v = val;
19011 }
19012 Ok(__struct)
19013 }
19014 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19015 let mut __tmp = BytesMut::new(bytes);
19016 #[allow(clippy::absurd_extreme_comparisons)]
19017 #[allow(unused_comparisons)]
19018 if __tmp.remaining() < Self::ENCODED_LEN {
19019 panic!(
19020 "buffer is too small (need {} bytes, but got {})",
19021 Self::ENCODED_LEN,
19022 __tmp.remaining(),
19023 )
19024 }
19025 __tmp.put_u32_le(self.ofs);
19026 __tmp.put_u16_le(self.id);
19027 __tmp.put_u8(self.count);
19028 for val in &self.data {
19029 __tmp.put_u8(*val);
19030 }
19031 if matches!(version, MavlinkVersion::V2) {
19032 let len = __tmp.len();
19033 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19034 } else {
19035 __tmp.len()
19036 }
19037 }
19038}
19039#[doc = "Reply to LOG_REQUEST_LIST."]
19040#[doc = ""]
19041#[doc = "ID: 118"]
19042#[derive(Debug, Clone, PartialEq)]
19043#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19044#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19045#[cfg_attr(feature = "ts", derive(TS))]
19046#[cfg_attr(feature = "ts", ts(export))]
19047pub struct LOG_ENTRY_DATA {
19048 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
19049 pub time_utc: u32,
19050 #[doc = "Size of the log (may be approximate)"]
19051 pub size: u32,
19052 #[doc = "Log id"]
19053 pub id: u16,
19054 #[doc = "Total number of logs"]
19055 pub num_logs: u16,
19056 #[doc = "High log number"]
19057 pub last_log_num: u16,
19058}
19059impl LOG_ENTRY_DATA {
19060 pub const ENCODED_LEN: usize = 14usize;
19061 pub const DEFAULT: Self = Self {
19062 time_utc: 0_u32,
19063 size: 0_u32,
19064 id: 0_u16,
19065 num_logs: 0_u16,
19066 last_log_num: 0_u16,
19067 };
19068 #[cfg(feature = "arbitrary")]
19069 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19070 use arbitrary::{Arbitrary, Unstructured};
19071 let mut buf = [0u8; 1024];
19072 rng.fill_bytes(&mut buf);
19073 let mut unstructured = Unstructured::new(&buf);
19074 Self::arbitrary(&mut unstructured).unwrap_or_default()
19075 }
19076}
19077impl Default for LOG_ENTRY_DATA {
19078 fn default() -> Self {
19079 Self::DEFAULT.clone()
19080 }
19081}
19082impl MessageData for LOG_ENTRY_DATA {
19083 type Message = MavMessage;
19084 const ID: u32 = 118u32;
19085 const NAME: &'static str = "LOG_ENTRY";
19086 const EXTRA_CRC: u8 = 56u8;
19087 const ENCODED_LEN: usize = 14usize;
19088 fn deser(
19089 _version: MavlinkVersion,
19090 __input: &[u8],
19091 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19092 let avail_len = __input.len();
19093 let mut payload_buf = [0; Self::ENCODED_LEN];
19094 let mut buf = if avail_len < Self::ENCODED_LEN {
19095 payload_buf[0..avail_len].copy_from_slice(__input);
19096 Bytes::new(&payload_buf)
19097 } else {
19098 Bytes::new(__input)
19099 };
19100 let mut __struct = Self::default();
19101 __struct.time_utc = buf.get_u32_le()?;
19102 __struct.size = buf.get_u32_le()?;
19103 __struct.id = buf.get_u16_le()?;
19104 __struct.num_logs = buf.get_u16_le()?;
19105 __struct.last_log_num = buf.get_u16_le()?;
19106 Ok(__struct)
19107 }
19108 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19109 let mut __tmp = BytesMut::new(bytes);
19110 #[allow(clippy::absurd_extreme_comparisons)]
19111 #[allow(unused_comparisons)]
19112 if __tmp.remaining() < Self::ENCODED_LEN {
19113 panic!(
19114 "buffer is too small (need {} bytes, but got {})",
19115 Self::ENCODED_LEN,
19116 __tmp.remaining(),
19117 )
19118 }
19119 __tmp.put_u32_le(self.time_utc);
19120 __tmp.put_u32_le(self.size);
19121 __tmp.put_u16_le(self.id);
19122 __tmp.put_u16_le(self.num_logs);
19123 __tmp.put_u16_le(self.last_log_num);
19124 if matches!(version, MavlinkVersion::V2) {
19125 let len = __tmp.len();
19126 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19127 } else {
19128 __tmp.len()
19129 }
19130 }
19131}
19132#[doc = "Erase all logs."]
19133#[doc = ""]
19134#[doc = "ID: 121"]
19135#[derive(Debug, Clone, PartialEq)]
19136#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19137#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19138#[cfg_attr(feature = "ts", derive(TS))]
19139#[cfg_attr(feature = "ts", ts(export))]
19140pub struct LOG_ERASE_DATA {
19141 #[doc = "System ID"]
19142 pub target_system: u8,
19143 #[doc = "Component ID"]
19144 pub target_component: u8,
19145}
19146impl LOG_ERASE_DATA {
19147 pub const ENCODED_LEN: usize = 2usize;
19148 pub const DEFAULT: Self = Self {
19149 target_system: 0_u8,
19150 target_component: 0_u8,
19151 };
19152 #[cfg(feature = "arbitrary")]
19153 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19154 use arbitrary::{Arbitrary, Unstructured};
19155 let mut buf = [0u8; 1024];
19156 rng.fill_bytes(&mut buf);
19157 let mut unstructured = Unstructured::new(&buf);
19158 Self::arbitrary(&mut unstructured).unwrap_or_default()
19159 }
19160}
19161impl Default for LOG_ERASE_DATA {
19162 fn default() -> Self {
19163 Self::DEFAULT.clone()
19164 }
19165}
19166impl MessageData for LOG_ERASE_DATA {
19167 type Message = MavMessage;
19168 const ID: u32 = 121u32;
19169 const NAME: &'static str = "LOG_ERASE";
19170 const EXTRA_CRC: u8 = 237u8;
19171 const ENCODED_LEN: usize = 2usize;
19172 fn deser(
19173 _version: MavlinkVersion,
19174 __input: &[u8],
19175 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19176 let avail_len = __input.len();
19177 let mut payload_buf = [0; Self::ENCODED_LEN];
19178 let mut buf = if avail_len < Self::ENCODED_LEN {
19179 payload_buf[0..avail_len].copy_from_slice(__input);
19180 Bytes::new(&payload_buf)
19181 } else {
19182 Bytes::new(__input)
19183 };
19184 let mut __struct = Self::default();
19185 __struct.target_system = buf.get_u8()?;
19186 __struct.target_component = buf.get_u8()?;
19187 Ok(__struct)
19188 }
19189 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19190 let mut __tmp = BytesMut::new(bytes);
19191 #[allow(clippy::absurd_extreme_comparisons)]
19192 #[allow(unused_comparisons)]
19193 if __tmp.remaining() < Self::ENCODED_LEN {
19194 panic!(
19195 "buffer is too small (need {} bytes, but got {})",
19196 Self::ENCODED_LEN,
19197 __tmp.remaining(),
19198 )
19199 }
19200 __tmp.put_u8(self.target_system);
19201 __tmp.put_u8(self.target_component);
19202 if matches!(version, MavlinkVersion::V2) {
19203 let len = __tmp.len();
19204 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19205 } else {
19206 __tmp.len()
19207 }
19208 }
19209}
19210#[doc = "Request a chunk of a log."]
19211#[doc = ""]
19212#[doc = "ID: 119"]
19213#[derive(Debug, Clone, PartialEq)]
19214#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19216#[cfg_attr(feature = "ts", derive(TS))]
19217#[cfg_attr(feature = "ts", ts(export))]
19218pub struct LOG_REQUEST_DATA_DATA {
19219 #[doc = "Offset into the log"]
19220 pub ofs: u32,
19221 #[doc = "Number of bytes"]
19222 pub count: u32,
19223 #[doc = "Log id (from LOG_ENTRY reply)"]
19224 pub id: u16,
19225 #[doc = "System ID"]
19226 pub target_system: u8,
19227 #[doc = "Component ID"]
19228 pub target_component: u8,
19229}
19230impl LOG_REQUEST_DATA_DATA {
19231 pub const ENCODED_LEN: usize = 12usize;
19232 pub const DEFAULT: Self = Self {
19233 ofs: 0_u32,
19234 count: 0_u32,
19235 id: 0_u16,
19236 target_system: 0_u8,
19237 target_component: 0_u8,
19238 };
19239 #[cfg(feature = "arbitrary")]
19240 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19241 use arbitrary::{Arbitrary, Unstructured};
19242 let mut buf = [0u8; 1024];
19243 rng.fill_bytes(&mut buf);
19244 let mut unstructured = Unstructured::new(&buf);
19245 Self::arbitrary(&mut unstructured).unwrap_or_default()
19246 }
19247}
19248impl Default for LOG_REQUEST_DATA_DATA {
19249 fn default() -> Self {
19250 Self::DEFAULT.clone()
19251 }
19252}
19253impl MessageData for LOG_REQUEST_DATA_DATA {
19254 type Message = MavMessage;
19255 const ID: u32 = 119u32;
19256 const NAME: &'static str = "LOG_REQUEST_DATA";
19257 const EXTRA_CRC: u8 = 116u8;
19258 const ENCODED_LEN: usize = 12usize;
19259 fn deser(
19260 _version: MavlinkVersion,
19261 __input: &[u8],
19262 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19263 let avail_len = __input.len();
19264 let mut payload_buf = [0; Self::ENCODED_LEN];
19265 let mut buf = if avail_len < Self::ENCODED_LEN {
19266 payload_buf[0..avail_len].copy_from_slice(__input);
19267 Bytes::new(&payload_buf)
19268 } else {
19269 Bytes::new(__input)
19270 };
19271 let mut __struct = Self::default();
19272 __struct.ofs = buf.get_u32_le()?;
19273 __struct.count = buf.get_u32_le()?;
19274 __struct.id = buf.get_u16_le()?;
19275 __struct.target_system = buf.get_u8()?;
19276 __struct.target_component = buf.get_u8()?;
19277 Ok(__struct)
19278 }
19279 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19280 let mut __tmp = BytesMut::new(bytes);
19281 #[allow(clippy::absurd_extreme_comparisons)]
19282 #[allow(unused_comparisons)]
19283 if __tmp.remaining() < Self::ENCODED_LEN {
19284 panic!(
19285 "buffer is too small (need {} bytes, but got {})",
19286 Self::ENCODED_LEN,
19287 __tmp.remaining(),
19288 )
19289 }
19290 __tmp.put_u32_le(self.ofs);
19291 __tmp.put_u32_le(self.count);
19292 __tmp.put_u16_le(self.id);
19293 __tmp.put_u8(self.target_system);
19294 __tmp.put_u8(self.target_component);
19295 if matches!(version, MavlinkVersion::V2) {
19296 let len = __tmp.len();
19297 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19298 } else {
19299 __tmp.len()
19300 }
19301 }
19302}
19303#[doc = "Stop log transfer and resume normal logging."]
19304#[doc = ""]
19305#[doc = "ID: 122"]
19306#[derive(Debug, Clone, PartialEq)]
19307#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19308#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19309#[cfg_attr(feature = "ts", derive(TS))]
19310#[cfg_attr(feature = "ts", ts(export))]
19311pub struct LOG_REQUEST_END_DATA {
19312 #[doc = "System ID"]
19313 pub target_system: u8,
19314 #[doc = "Component ID"]
19315 pub target_component: u8,
19316}
19317impl LOG_REQUEST_END_DATA {
19318 pub const ENCODED_LEN: usize = 2usize;
19319 pub const DEFAULT: Self = Self {
19320 target_system: 0_u8,
19321 target_component: 0_u8,
19322 };
19323 #[cfg(feature = "arbitrary")]
19324 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19325 use arbitrary::{Arbitrary, Unstructured};
19326 let mut buf = [0u8; 1024];
19327 rng.fill_bytes(&mut buf);
19328 let mut unstructured = Unstructured::new(&buf);
19329 Self::arbitrary(&mut unstructured).unwrap_or_default()
19330 }
19331}
19332impl Default for LOG_REQUEST_END_DATA {
19333 fn default() -> Self {
19334 Self::DEFAULT.clone()
19335 }
19336}
19337impl MessageData for LOG_REQUEST_END_DATA {
19338 type Message = MavMessage;
19339 const ID: u32 = 122u32;
19340 const NAME: &'static str = "LOG_REQUEST_END";
19341 const EXTRA_CRC: u8 = 203u8;
19342 const ENCODED_LEN: usize = 2usize;
19343 fn deser(
19344 _version: MavlinkVersion,
19345 __input: &[u8],
19346 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19347 let avail_len = __input.len();
19348 let mut payload_buf = [0; Self::ENCODED_LEN];
19349 let mut buf = if avail_len < Self::ENCODED_LEN {
19350 payload_buf[0..avail_len].copy_from_slice(__input);
19351 Bytes::new(&payload_buf)
19352 } else {
19353 Bytes::new(__input)
19354 };
19355 let mut __struct = Self::default();
19356 __struct.target_system = buf.get_u8()?;
19357 __struct.target_component = buf.get_u8()?;
19358 Ok(__struct)
19359 }
19360 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19361 let mut __tmp = BytesMut::new(bytes);
19362 #[allow(clippy::absurd_extreme_comparisons)]
19363 #[allow(unused_comparisons)]
19364 if __tmp.remaining() < Self::ENCODED_LEN {
19365 panic!(
19366 "buffer is too small (need {} bytes, but got {})",
19367 Self::ENCODED_LEN,
19368 __tmp.remaining(),
19369 )
19370 }
19371 __tmp.put_u8(self.target_system);
19372 __tmp.put_u8(self.target_component);
19373 if matches!(version, MavlinkVersion::V2) {
19374 let len = __tmp.len();
19375 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19376 } else {
19377 __tmp.len()
19378 }
19379 }
19380}
19381#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
19382#[doc = ""]
19383#[doc = "ID: 117"]
19384#[derive(Debug, Clone, PartialEq)]
19385#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19386#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19387#[cfg_attr(feature = "ts", derive(TS))]
19388#[cfg_attr(feature = "ts", ts(export))]
19389pub struct LOG_REQUEST_LIST_DATA {
19390 #[doc = "First log id (0 for first available)"]
19391 pub start: u16,
19392 #[doc = "Last log id (0xffff for last available)"]
19393 pub end: u16,
19394 #[doc = "System ID"]
19395 pub target_system: u8,
19396 #[doc = "Component ID"]
19397 pub target_component: u8,
19398}
19399impl LOG_REQUEST_LIST_DATA {
19400 pub const ENCODED_LEN: usize = 6usize;
19401 pub const DEFAULT: Self = Self {
19402 start: 0_u16,
19403 end: 0_u16,
19404 target_system: 0_u8,
19405 target_component: 0_u8,
19406 };
19407 #[cfg(feature = "arbitrary")]
19408 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19409 use arbitrary::{Arbitrary, Unstructured};
19410 let mut buf = [0u8; 1024];
19411 rng.fill_bytes(&mut buf);
19412 let mut unstructured = Unstructured::new(&buf);
19413 Self::arbitrary(&mut unstructured).unwrap_or_default()
19414 }
19415}
19416impl Default for LOG_REQUEST_LIST_DATA {
19417 fn default() -> Self {
19418 Self::DEFAULT.clone()
19419 }
19420}
19421impl MessageData for LOG_REQUEST_LIST_DATA {
19422 type Message = MavMessage;
19423 const ID: u32 = 117u32;
19424 const NAME: &'static str = "LOG_REQUEST_LIST";
19425 const EXTRA_CRC: u8 = 128u8;
19426 const ENCODED_LEN: usize = 6usize;
19427 fn deser(
19428 _version: MavlinkVersion,
19429 __input: &[u8],
19430 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19431 let avail_len = __input.len();
19432 let mut payload_buf = [0; Self::ENCODED_LEN];
19433 let mut buf = if avail_len < Self::ENCODED_LEN {
19434 payload_buf[0..avail_len].copy_from_slice(__input);
19435 Bytes::new(&payload_buf)
19436 } else {
19437 Bytes::new(__input)
19438 };
19439 let mut __struct = Self::default();
19440 __struct.start = buf.get_u16_le()?;
19441 __struct.end = buf.get_u16_le()?;
19442 __struct.target_system = buf.get_u8()?;
19443 __struct.target_component = buf.get_u8()?;
19444 Ok(__struct)
19445 }
19446 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19447 let mut __tmp = BytesMut::new(bytes);
19448 #[allow(clippy::absurd_extreme_comparisons)]
19449 #[allow(unused_comparisons)]
19450 if __tmp.remaining() < Self::ENCODED_LEN {
19451 panic!(
19452 "buffer is too small (need {} bytes, but got {})",
19453 Self::ENCODED_LEN,
19454 __tmp.remaining(),
19455 )
19456 }
19457 __tmp.put_u16_le(self.start);
19458 __tmp.put_u16_le(self.end);
19459 __tmp.put_u8(self.target_system);
19460 __tmp.put_u8(self.target_component);
19461 if matches!(version, MavlinkVersion::V2) {
19462 let len = __tmp.len();
19463 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19464 } else {
19465 __tmp.len()
19466 }
19467 }
19468}
19469#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
19470#[doc = ""]
19471#[doc = "ID: 192"]
19472#[derive(Debug, Clone, PartialEq)]
19473#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19474#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19475#[cfg_attr(feature = "ts", derive(TS))]
19476#[cfg_attr(feature = "ts", ts(export))]
19477pub struct MAG_CAL_REPORT_DATA {
19478 #[doc = "RMS milligauss residuals."]
19479 pub fitness: f32,
19480 #[doc = "X offset."]
19481 pub ofs_x: f32,
19482 #[doc = "Y offset."]
19483 pub ofs_y: f32,
19484 #[doc = "Z offset."]
19485 pub ofs_z: f32,
19486 #[doc = "X diagonal (matrix 11)."]
19487 pub diag_x: f32,
19488 #[doc = "Y diagonal (matrix 22)."]
19489 pub diag_y: f32,
19490 #[doc = "Z diagonal (matrix 33)."]
19491 pub diag_z: f32,
19492 #[doc = "X off-diagonal (matrix 12 and 21)."]
19493 pub offdiag_x: f32,
19494 #[doc = "Y off-diagonal (matrix 13 and 31)."]
19495 pub offdiag_y: f32,
19496 #[doc = "Z off-diagonal (matrix 32 and 23)."]
19497 pub offdiag_z: f32,
19498 #[doc = "Compass being calibrated."]
19499 pub compass_id: u8,
19500 #[doc = "Bitmask of compasses being calibrated."]
19501 pub cal_mask: u8,
19502 #[doc = "Calibration Status."]
19503 pub cal_status: MagCalStatus,
19504 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
19505 pub autosaved: u8,
19506 #[doc = "Confidence in orientation (higher is better)."]
19507 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19508 pub orientation_confidence: f32,
19509 #[doc = "orientation before calibration."]
19510 #[cfg_attr(feature = "serde", serde(default))]
19511 pub old_orientation: MavSensorOrientation,
19512 #[doc = "orientation after calibration."]
19513 #[cfg_attr(feature = "serde", serde(default))]
19514 pub new_orientation: MavSensorOrientation,
19515 #[doc = "field radius correction factor"]
19516 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19517 pub scale_factor: f32,
19518}
19519impl MAG_CAL_REPORT_DATA {
19520 pub const ENCODED_LEN: usize = 54usize;
19521 pub const DEFAULT: Self = Self {
19522 fitness: 0.0_f32,
19523 ofs_x: 0.0_f32,
19524 ofs_y: 0.0_f32,
19525 ofs_z: 0.0_f32,
19526 diag_x: 0.0_f32,
19527 diag_y: 0.0_f32,
19528 diag_z: 0.0_f32,
19529 offdiag_x: 0.0_f32,
19530 offdiag_y: 0.0_f32,
19531 offdiag_z: 0.0_f32,
19532 compass_id: 0_u8,
19533 cal_mask: 0_u8,
19534 cal_status: MagCalStatus::DEFAULT,
19535 autosaved: 0_u8,
19536 orientation_confidence: 0.0_f32,
19537 old_orientation: MavSensorOrientation::DEFAULT,
19538 new_orientation: MavSensorOrientation::DEFAULT,
19539 scale_factor: 0.0_f32,
19540 };
19541 #[cfg(feature = "arbitrary")]
19542 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19543 use arbitrary::{Arbitrary, Unstructured};
19544 let mut buf = [0u8; 1024];
19545 rng.fill_bytes(&mut buf);
19546 let mut unstructured = Unstructured::new(&buf);
19547 Self::arbitrary(&mut unstructured).unwrap_or_default()
19548 }
19549}
19550impl Default for MAG_CAL_REPORT_DATA {
19551 fn default() -> Self {
19552 Self::DEFAULT.clone()
19553 }
19554}
19555impl MessageData for MAG_CAL_REPORT_DATA {
19556 type Message = MavMessage;
19557 const ID: u32 = 192u32;
19558 const NAME: &'static str = "MAG_CAL_REPORT";
19559 const EXTRA_CRC: u8 = 36u8;
19560 const ENCODED_LEN: usize = 54usize;
19561 fn deser(
19562 _version: MavlinkVersion,
19563 __input: &[u8],
19564 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19565 let avail_len = __input.len();
19566 let mut payload_buf = [0; Self::ENCODED_LEN];
19567 let mut buf = if avail_len < Self::ENCODED_LEN {
19568 payload_buf[0..avail_len].copy_from_slice(__input);
19569 Bytes::new(&payload_buf)
19570 } else {
19571 Bytes::new(__input)
19572 };
19573 let mut __struct = Self::default();
19574 __struct.fitness = buf.get_f32_le()?;
19575 __struct.ofs_x = buf.get_f32_le()?;
19576 __struct.ofs_y = buf.get_f32_le()?;
19577 __struct.ofs_z = buf.get_f32_le()?;
19578 __struct.diag_x = buf.get_f32_le()?;
19579 __struct.diag_y = buf.get_f32_le()?;
19580 __struct.diag_z = buf.get_f32_le()?;
19581 __struct.offdiag_x = buf.get_f32_le()?;
19582 __struct.offdiag_y = buf.get_f32_le()?;
19583 __struct.offdiag_z = buf.get_f32_le()?;
19584 __struct.compass_id = buf.get_u8()?;
19585 __struct.cal_mask = buf.get_u8()?;
19586 let tmp = buf.get_u8()?;
19587 __struct.cal_status =
19588 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19589 enum_type: "MagCalStatus",
19590 value: tmp as u64,
19591 })?;
19592 __struct.autosaved = buf.get_u8()?;
19593 __struct.orientation_confidence = buf.get_f32_le()?;
19594 let tmp = buf.get_u8()?;
19595 __struct.old_orientation =
19596 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19597 enum_type: "MavSensorOrientation",
19598 value: tmp as u64,
19599 })?;
19600 let tmp = buf.get_u8()?;
19601 __struct.new_orientation =
19602 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19603 enum_type: "MavSensorOrientation",
19604 value: tmp as u64,
19605 })?;
19606 __struct.scale_factor = buf.get_f32_le()?;
19607 Ok(__struct)
19608 }
19609 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19610 let mut __tmp = BytesMut::new(bytes);
19611 #[allow(clippy::absurd_extreme_comparisons)]
19612 #[allow(unused_comparisons)]
19613 if __tmp.remaining() < Self::ENCODED_LEN {
19614 panic!(
19615 "buffer is too small (need {} bytes, but got {})",
19616 Self::ENCODED_LEN,
19617 __tmp.remaining(),
19618 )
19619 }
19620 __tmp.put_f32_le(self.fitness);
19621 __tmp.put_f32_le(self.ofs_x);
19622 __tmp.put_f32_le(self.ofs_y);
19623 __tmp.put_f32_le(self.ofs_z);
19624 __tmp.put_f32_le(self.diag_x);
19625 __tmp.put_f32_le(self.diag_y);
19626 __tmp.put_f32_le(self.diag_z);
19627 __tmp.put_f32_le(self.offdiag_x);
19628 __tmp.put_f32_le(self.offdiag_y);
19629 __tmp.put_f32_le(self.offdiag_z);
19630 __tmp.put_u8(self.compass_id);
19631 __tmp.put_u8(self.cal_mask);
19632 __tmp.put_u8(self.cal_status as u8);
19633 __tmp.put_u8(self.autosaved);
19634 if matches!(version, MavlinkVersion::V2) {
19635 __tmp.put_f32_le(self.orientation_confidence);
19636 __tmp.put_u8(self.old_orientation as u8);
19637 __tmp.put_u8(self.new_orientation as u8);
19638 __tmp.put_f32_le(self.scale_factor);
19639 let len = __tmp.len();
19640 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19641 } else {
19642 __tmp.len()
19643 }
19644 }
19645}
19646#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
19647#[doc = ""]
19648#[doc = "ID: 69"]
19649#[derive(Debug, Clone, PartialEq)]
19650#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19651#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19652#[cfg_attr(feature = "ts", derive(TS))]
19653#[cfg_attr(feature = "ts", ts(export))]
19654pub struct MANUAL_CONTROL_DATA {
19655 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
19656 pub x: i16,
19657 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
19658 pub y: i16,
19659 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
19660 pub z: i16,
19661 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
19662 pub r: i16,
19663 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
19664 pub buttons: u16,
19665 #[doc = "The system to be controlled."]
19666 pub target: u8,
19667 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
19668 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19669 pub buttons2: u16,
19670 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
19671 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19672 pub enabled_extensions: u8,
19673 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
19674 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19675 pub s: i16,
19676 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
19677 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19678 pub t: i16,
19679 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
19680 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19681 pub aux1: i16,
19682 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
19683 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19684 pub aux2: i16,
19685 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
19686 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19687 pub aux3: i16,
19688 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
19689 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19690 pub aux4: i16,
19691 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
19692 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19693 pub aux5: i16,
19694 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
19695 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19696 pub aux6: i16,
19697}
19698impl MANUAL_CONTROL_DATA {
19699 pub const ENCODED_LEN: usize = 30usize;
19700 pub const DEFAULT: Self = Self {
19701 x: 0_i16,
19702 y: 0_i16,
19703 z: 0_i16,
19704 r: 0_i16,
19705 buttons: 0_u16,
19706 target: 0_u8,
19707 buttons2: 0_u16,
19708 enabled_extensions: 0_u8,
19709 s: 0_i16,
19710 t: 0_i16,
19711 aux1: 0_i16,
19712 aux2: 0_i16,
19713 aux3: 0_i16,
19714 aux4: 0_i16,
19715 aux5: 0_i16,
19716 aux6: 0_i16,
19717 };
19718 #[cfg(feature = "arbitrary")]
19719 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19720 use arbitrary::{Arbitrary, Unstructured};
19721 let mut buf = [0u8; 1024];
19722 rng.fill_bytes(&mut buf);
19723 let mut unstructured = Unstructured::new(&buf);
19724 Self::arbitrary(&mut unstructured).unwrap_or_default()
19725 }
19726}
19727impl Default for MANUAL_CONTROL_DATA {
19728 fn default() -> Self {
19729 Self::DEFAULT.clone()
19730 }
19731}
19732impl MessageData for MANUAL_CONTROL_DATA {
19733 type Message = MavMessage;
19734 const ID: u32 = 69u32;
19735 const NAME: &'static str = "MANUAL_CONTROL";
19736 const EXTRA_CRC: u8 = 243u8;
19737 const ENCODED_LEN: usize = 30usize;
19738 fn deser(
19739 _version: MavlinkVersion,
19740 __input: &[u8],
19741 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19742 let avail_len = __input.len();
19743 let mut payload_buf = [0; Self::ENCODED_LEN];
19744 let mut buf = if avail_len < Self::ENCODED_LEN {
19745 payload_buf[0..avail_len].copy_from_slice(__input);
19746 Bytes::new(&payload_buf)
19747 } else {
19748 Bytes::new(__input)
19749 };
19750 let mut __struct = Self::default();
19751 __struct.x = buf.get_i16_le()?;
19752 __struct.y = buf.get_i16_le()?;
19753 __struct.z = buf.get_i16_le()?;
19754 __struct.r = buf.get_i16_le()?;
19755 __struct.buttons = buf.get_u16_le()?;
19756 __struct.target = buf.get_u8()?;
19757 __struct.buttons2 = buf.get_u16_le()?;
19758 __struct.enabled_extensions = buf.get_u8()?;
19759 __struct.s = buf.get_i16_le()?;
19760 __struct.t = buf.get_i16_le()?;
19761 __struct.aux1 = buf.get_i16_le()?;
19762 __struct.aux2 = buf.get_i16_le()?;
19763 __struct.aux3 = buf.get_i16_le()?;
19764 __struct.aux4 = buf.get_i16_le()?;
19765 __struct.aux5 = buf.get_i16_le()?;
19766 __struct.aux6 = buf.get_i16_le()?;
19767 Ok(__struct)
19768 }
19769 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19770 let mut __tmp = BytesMut::new(bytes);
19771 #[allow(clippy::absurd_extreme_comparisons)]
19772 #[allow(unused_comparisons)]
19773 if __tmp.remaining() < Self::ENCODED_LEN {
19774 panic!(
19775 "buffer is too small (need {} bytes, but got {})",
19776 Self::ENCODED_LEN,
19777 __tmp.remaining(),
19778 )
19779 }
19780 __tmp.put_i16_le(self.x);
19781 __tmp.put_i16_le(self.y);
19782 __tmp.put_i16_le(self.z);
19783 __tmp.put_i16_le(self.r);
19784 __tmp.put_u16_le(self.buttons);
19785 __tmp.put_u8(self.target);
19786 if matches!(version, MavlinkVersion::V2) {
19787 __tmp.put_u16_le(self.buttons2);
19788 __tmp.put_u8(self.enabled_extensions);
19789 __tmp.put_i16_le(self.s);
19790 __tmp.put_i16_le(self.t);
19791 __tmp.put_i16_le(self.aux1);
19792 __tmp.put_i16_le(self.aux2);
19793 __tmp.put_i16_le(self.aux3);
19794 __tmp.put_i16_le(self.aux4);
19795 __tmp.put_i16_le(self.aux5);
19796 __tmp.put_i16_le(self.aux6);
19797 let len = __tmp.len();
19798 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19799 } else {
19800 __tmp.len()
19801 }
19802 }
19803}
19804#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
19805#[doc = ""]
19806#[doc = "ID: 81"]
19807#[derive(Debug, Clone, PartialEq)]
19808#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19809#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19810#[cfg_attr(feature = "ts", derive(TS))]
19811#[cfg_attr(feature = "ts", ts(export))]
19812pub struct MANUAL_SETPOINT_DATA {
19813 #[doc = "Timestamp (time since system boot)."]
19814 pub time_boot_ms: u32,
19815 #[doc = "Desired roll rate"]
19816 pub roll: f32,
19817 #[doc = "Desired pitch rate"]
19818 pub pitch: f32,
19819 #[doc = "Desired yaw rate"]
19820 pub yaw: f32,
19821 #[doc = "Collective thrust, normalized to 0 .. 1"]
19822 pub thrust: f32,
19823 #[doc = "Flight mode switch position, 0.. 255"]
19824 pub mode_switch: u8,
19825 #[doc = "Override mode switch position, 0.. 255"]
19826 pub manual_override_switch: u8,
19827}
19828impl MANUAL_SETPOINT_DATA {
19829 pub const ENCODED_LEN: usize = 22usize;
19830 pub const DEFAULT: Self = Self {
19831 time_boot_ms: 0_u32,
19832 roll: 0.0_f32,
19833 pitch: 0.0_f32,
19834 yaw: 0.0_f32,
19835 thrust: 0.0_f32,
19836 mode_switch: 0_u8,
19837 manual_override_switch: 0_u8,
19838 };
19839 #[cfg(feature = "arbitrary")]
19840 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19841 use arbitrary::{Arbitrary, Unstructured};
19842 let mut buf = [0u8; 1024];
19843 rng.fill_bytes(&mut buf);
19844 let mut unstructured = Unstructured::new(&buf);
19845 Self::arbitrary(&mut unstructured).unwrap_or_default()
19846 }
19847}
19848impl Default for MANUAL_SETPOINT_DATA {
19849 fn default() -> Self {
19850 Self::DEFAULT.clone()
19851 }
19852}
19853impl MessageData for MANUAL_SETPOINT_DATA {
19854 type Message = MavMessage;
19855 const ID: u32 = 81u32;
19856 const NAME: &'static str = "MANUAL_SETPOINT";
19857 const EXTRA_CRC: u8 = 106u8;
19858 const ENCODED_LEN: usize = 22usize;
19859 fn deser(
19860 _version: MavlinkVersion,
19861 __input: &[u8],
19862 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19863 let avail_len = __input.len();
19864 let mut payload_buf = [0; Self::ENCODED_LEN];
19865 let mut buf = if avail_len < Self::ENCODED_LEN {
19866 payload_buf[0..avail_len].copy_from_slice(__input);
19867 Bytes::new(&payload_buf)
19868 } else {
19869 Bytes::new(__input)
19870 };
19871 let mut __struct = Self::default();
19872 __struct.time_boot_ms = buf.get_u32_le()?;
19873 __struct.roll = buf.get_f32_le()?;
19874 __struct.pitch = buf.get_f32_le()?;
19875 __struct.yaw = buf.get_f32_le()?;
19876 __struct.thrust = buf.get_f32_le()?;
19877 __struct.mode_switch = buf.get_u8()?;
19878 __struct.manual_override_switch = buf.get_u8()?;
19879 Ok(__struct)
19880 }
19881 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19882 let mut __tmp = BytesMut::new(bytes);
19883 #[allow(clippy::absurd_extreme_comparisons)]
19884 #[allow(unused_comparisons)]
19885 if __tmp.remaining() < Self::ENCODED_LEN {
19886 panic!(
19887 "buffer is too small (need {} bytes, but got {})",
19888 Self::ENCODED_LEN,
19889 __tmp.remaining(),
19890 )
19891 }
19892 __tmp.put_u32_le(self.time_boot_ms);
19893 __tmp.put_f32_le(self.roll);
19894 __tmp.put_f32_le(self.pitch);
19895 __tmp.put_f32_le(self.yaw);
19896 __tmp.put_f32_le(self.thrust);
19897 __tmp.put_u8(self.mode_switch);
19898 __tmp.put_u8(self.manual_override_switch);
19899 if matches!(version, MavlinkVersion::V2) {
19900 let len = __tmp.len();
19901 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19902 } else {
19903 __tmp.len()
19904 }
19905 }
19906}
19907#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
19908#[doc = ""]
19909#[doc = "ID: 249"]
19910#[derive(Debug, Clone, PartialEq)]
19911#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19912#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19913#[cfg_attr(feature = "ts", derive(TS))]
19914#[cfg_attr(feature = "ts", ts(export))]
19915pub struct MEMORY_VECT_DATA {
19916 #[doc = "Starting address of the debug variables"]
19917 pub address: u16,
19918 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
19919 pub ver: u8,
19920 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
19921 pub mavtype: u8,
19922 #[doc = "Memory contents at specified address"]
19923 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19924 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
19925 pub value: [i8; 32],
19926}
19927impl MEMORY_VECT_DATA {
19928 pub const ENCODED_LEN: usize = 36usize;
19929 pub const DEFAULT: Self = Self {
19930 address: 0_u16,
19931 ver: 0_u8,
19932 mavtype: 0_u8,
19933 value: [0_i8; 32usize],
19934 };
19935 #[cfg(feature = "arbitrary")]
19936 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19937 use arbitrary::{Arbitrary, Unstructured};
19938 let mut buf = [0u8; 1024];
19939 rng.fill_bytes(&mut buf);
19940 let mut unstructured = Unstructured::new(&buf);
19941 Self::arbitrary(&mut unstructured).unwrap_or_default()
19942 }
19943}
19944impl Default for MEMORY_VECT_DATA {
19945 fn default() -> Self {
19946 Self::DEFAULT.clone()
19947 }
19948}
19949impl MessageData for MEMORY_VECT_DATA {
19950 type Message = MavMessage;
19951 const ID: u32 = 249u32;
19952 const NAME: &'static str = "MEMORY_VECT";
19953 const EXTRA_CRC: u8 = 204u8;
19954 const ENCODED_LEN: usize = 36usize;
19955 fn deser(
19956 _version: MavlinkVersion,
19957 __input: &[u8],
19958 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19959 let avail_len = __input.len();
19960 let mut payload_buf = [0; Self::ENCODED_LEN];
19961 let mut buf = if avail_len < Self::ENCODED_LEN {
19962 payload_buf[0..avail_len].copy_from_slice(__input);
19963 Bytes::new(&payload_buf)
19964 } else {
19965 Bytes::new(__input)
19966 };
19967 let mut __struct = Self::default();
19968 __struct.address = buf.get_u16_le()?;
19969 __struct.ver = buf.get_u8()?;
19970 __struct.mavtype = buf.get_u8()?;
19971 for v in &mut __struct.value {
19972 let val = buf.get_i8()?;
19973 *v = val;
19974 }
19975 Ok(__struct)
19976 }
19977 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19978 let mut __tmp = BytesMut::new(bytes);
19979 #[allow(clippy::absurd_extreme_comparisons)]
19980 #[allow(unused_comparisons)]
19981 if __tmp.remaining() < Self::ENCODED_LEN {
19982 panic!(
19983 "buffer is too small (need {} bytes, but got {})",
19984 Self::ENCODED_LEN,
19985 __tmp.remaining(),
19986 )
19987 }
19988 __tmp.put_u16_le(self.address);
19989 __tmp.put_u8(self.ver);
19990 __tmp.put_u8(self.mavtype);
19991 for val in &self.value {
19992 __tmp.put_i8(*val);
19993 }
19994 if matches!(version, MavlinkVersion::V2) {
19995 let len = __tmp.len();
19996 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19997 } else {
19998 __tmp.len()
19999 }
20000 }
20001}
20002#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
20003#[doc = ""]
20004#[doc = "ID: 244"]
20005#[derive(Debug, Clone, PartialEq)]
20006#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20007#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20008#[cfg_attr(feature = "ts", derive(TS))]
20009#[cfg_attr(feature = "ts", ts(export))]
20010pub struct MESSAGE_INTERVAL_DATA {
20011 #[doc = "0 indicates the interval at which it is sent."]
20012 pub interval_us: i32,
20013 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
20014 pub message_id: u16,
20015}
20016impl MESSAGE_INTERVAL_DATA {
20017 pub const ENCODED_LEN: usize = 6usize;
20018 pub const DEFAULT: Self = Self {
20019 interval_us: 0_i32,
20020 message_id: 0_u16,
20021 };
20022 #[cfg(feature = "arbitrary")]
20023 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20024 use arbitrary::{Arbitrary, Unstructured};
20025 let mut buf = [0u8; 1024];
20026 rng.fill_bytes(&mut buf);
20027 let mut unstructured = Unstructured::new(&buf);
20028 Self::arbitrary(&mut unstructured).unwrap_or_default()
20029 }
20030}
20031impl Default for MESSAGE_INTERVAL_DATA {
20032 fn default() -> Self {
20033 Self::DEFAULT.clone()
20034 }
20035}
20036impl MessageData for MESSAGE_INTERVAL_DATA {
20037 type Message = MavMessage;
20038 const ID: u32 = 244u32;
20039 const NAME: &'static str = "MESSAGE_INTERVAL";
20040 const EXTRA_CRC: u8 = 95u8;
20041 const ENCODED_LEN: usize = 6usize;
20042 fn deser(
20043 _version: MavlinkVersion,
20044 __input: &[u8],
20045 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20046 let avail_len = __input.len();
20047 let mut payload_buf = [0; Self::ENCODED_LEN];
20048 let mut buf = if avail_len < Self::ENCODED_LEN {
20049 payload_buf[0..avail_len].copy_from_slice(__input);
20050 Bytes::new(&payload_buf)
20051 } else {
20052 Bytes::new(__input)
20053 };
20054 let mut __struct = Self::default();
20055 __struct.interval_us = buf.get_i32_le()?;
20056 __struct.message_id = buf.get_u16_le()?;
20057 Ok(__struct)
20058 }
20059 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20060 let mut __tmp = BytesMut::new(bytes);
20061 #[allow(clippy::absurd_extreme_comparisons)]
20062 #[allow(unused_comparisons)]
20063 if __tmp.remaining() < Self::ENCODED_LEN {
20064 panic!(
20065 "buffer is too small (need {} bytes, but got {})",
20066 Self::ENCODED_LEN,
20067 __tmp.remaining(),
20068 )
20069 }
20070 __tmp.put_i32_le(self.interval_us);
20071 __tmp.put_u16_le(self.message_id);
20072 if matches!(version, MavlinkVersion::V2) {
20073 let len = __tmp.len();
20074 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20075 } else {
20076 __tmp.len()
20077 }
20078 }
20079}
20080#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
20081#[doc = ""]
20082#[doc = "ID: 47"]
20083#[derive(Debug, Clone, PartialEq)]
20084#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20085#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20086#[cfg_attr(feature = "ts", derive(TS))]
20087#[cfg_attr(feature = "ts", ts(export))]
20088pub struct MISSION_ACK_DATA {
20089 #[doc = "System ID"]
20090 pub target_system: u8,
20091 #[doc = "Component ID"]
20092 pub target_component: u8,
20093 #[doc = "Mission result."]
20094 pub mavtype: MavMissionResult,
20095 #[doc = "Mission type."]
20096 #[cfg_attr(feature = "serde", serde(default))]
20097 pub mission_type: MavMissionType,
20098 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
20099 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20100 pub opaque_id: u32,
20101}
20102impl MISSION_ACK_DATA {
20103 pub const ENCODED_LEN: usize = 8usize;
20104 pub const DEFAULT: Self = Self {
20105 target_system: 0_u8,
20106 target_component: 0_u8,
20107 mavtype: MavMissionResult::DEFAULT,
20108 mission_type: MavMissionType::DEFAULT,
20109 opaque_id: 0_u32,
20110 };
20111 #[cfg(feature = "arbitrary")]
20112 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20113 use arbitrary::{Arbitrary, Unstructured};
20114 let mut buf = [0u8; 1024];
20115 rng.fill_bytes(&mut buf);
20116 let mut unstructured = Unstructured::new(&buf);
20117 Self::arbitrary(&mut unstructured).unwrap_or_default()
20118 }
20119}
20120impl Default for MISSION_ACK_DATA {
20121 fn default() -> Self {
20122 Self::DEFAULT.clone()
20123 }
20124}
20125impl MessageData for MISSION_ACK_DATA {
20126 type Message = MavMessage;
20127 const ID: u32 = 47u32;
20128 const NAME: &'static str = "MISSION_ACK";
20129 const EXTRA_CRC: u8 = 153u8;
20130 const ENCODED_LEN: usize = 8usize;
20131 fn deser(
20132 _version: MavlinkVersion,
20133 __input: &[u8],
20134 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20135 let avail_len = __input.len();
20136 let mut payload_buf = [0; Self::ENCODED_LEN];
20137 let mut buf = if avail_len < Self::ENCODED_LEN {
20138 payload_buf[0..avail_len].copy_from_slice(__input);
20139 Bytes::new(&payload_buf)
20140 } else {
20141 Bytes::new(__input)
20142 };
20143 let mut __struct = Self::default();
20144 __struct.target_system = buf.get_u8()?;
20145 __struct.target_component = buf.get_u8()?;
20146 let tmp = buf.get_u8()?;
20147 __struct.mavtype =
20148 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20149 enum_type: "MavMissionResult",
20150 value: tmp as u64,
20151 })?;
20152 let tmp = buf.get_u8()?;
20153 __struct.mission_type =
20154 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20155 enum_type: "MavMissionType",
20156 value: tmp as u64,
20157 })?;
20158 __struct.opaque_id = buf.get_u32_le()?;
20159 Ok(__struct)
20160 }
20161 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20162 let mut __tmp = BytesMut::new(bytes);
20163 #[allow(clippy::absurd_extreme_comparisons)]
20164 #[allow(unused_comparisons)]
20165 if __tmp.remaining() < Self::ENCODED_LEN {
20166 panic!(
20167 "buffer is too small (need {} bytes, but got {})",
20168 Self::ENCODED_LEN,
20169 __tmp.remaining(),
20170 )
20171 }
20172 __tmp.put_u8(self.target_system);
20173 __tmp.put_u8(self.target_component);
20174 __tmp.put_u8(self.mavtype as u8);
20175 if matches!(version, MavlinkVersion::V2) {
20176 __tmp.put_u8(self.mission_type as u8);
20177 __tmp.put_u32_le(self.opaque_id);
20178 let len = __tmp.len();
20179 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20180 } else {
20181 __tmp.len()
20182 }
20183 }
20184}
20185#[doc = "Delete all mission items at once."]
20186#[doc = ""]
20187#[doc = "ID: 45"]
20188#[derive(Debug, Clone, PartialEq)]
20189#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20190#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20191#[cfg_attr(feature = "ts", derive(TS))]
20192#[cfg_attr(feature = "ts", ts(export))]
20193pub struct MISSION_CLEAR_ALL_DATA {
20194 #[doc = "System ID"]
20195 pub target_system: u8,
20196 #[doc = "Component ID"]
20197 pub target_component: u8,
20198 #[doc = "Mission type."]
20199 #[cfg_attr(feature = "serde", serde(default))]
20200 pub mission_type: MavMissionType,
20201}
20202impl MISSION_CLEAR_ALL_DATA {
20203 pub const ENCODED_LEN: usize = 3usize;
20204 pub const DEFAULT: Self = Self {
20205 target_system: 0_u8,
20206 target_component: 0_u8,
20207 mission_type: MavMissionType::DEFAULT,
20208 };
20209 #[cfg(feature = "arbitrary")]
20210 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20211 use arbitrary::{Arbitrary, Unstructured};
20212 let mut buf = [0u8; 1024];
20213 rng.fill_bytes(&mut buf);
20214 let mut unstructured = Unstructured::new(&buf);
20215 Self::arbitrary(&mut unstructured).unwrap_or_default()
20216 }
20217}
20218impl Default for MISSION_CLEAR_ALL_DATA {
20219 fn default() -> Self {
20220 Self::DEFAULT.clone()
20221 }
20222}
20223impl MessageData for MISSION_CLEAR_ALL_DATA {
20224 type Message = MavMessage;
20225 const ID: u32 = 45u32;
20226 const NAME: &'static str = "MISSION_CLEAR_ALL";
20227 const EXTRA_CRC: u8 = 232u8;
20228 const ENCODED_LEN: usize = 3usize;
20229 fn deser(
20230 _version: MavlinkVersion,
20231 __input: &[u8],
20232 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20233 let avail_len = __input.len();
20234 let mut payload_buf = [0; Self::ENCODED_LEN];
20235 let mut buf = if avail_len < Self::ENCODED_LEN {
20236 payload_buf[0..avail_len].copy_from_slice(__input);
20237 Bytes::new(&payload_buf)
20238 } else {
20239 Bytes::new(__input)
20240 };
20241 let mut __struct = Self::default();
20242 __struct.target_system = buf.get_u8()?;
20243 __struct.target_component = buf.get_u8()?;
20244 let tmp = buf.get_u8()?;
20245 __struct.mission_type =
20246 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20247 enum_type: "MavMissionType",
20248 value: tmp as u64,
20249 })?;
20250 Ok(__struct)
20251 }
20252 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20253 let mut __tmp = BytesMut::new(bytes);
20254 #[allow(clippy::absurd_extreme_comparisons)]
20255 #[allow(unused_comparisons)]
20256 if __tmp.remaining() < Self::ENCODED_LEN {
20257 panic!(
20258 "buffer is too small (need {} bytes, but got {})",
20259 Self::ENCODED_LEN,
20260 __tmp.remaining(),
20261 )
20262 }
20263 __tmp.put_u8(self.target_system);
20264 __tmp.put_u8(self.target_component);
20265 if matches!(version, MavlinkVersion::V2) {
20266 __tmp.put_u8(self.mission_type as u8);
20267 let len = __tmp.len();
20268 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20269 } else {
20270 __tmp.len()
20271 }
20272 }
20273}
20274#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
20275#[doc = ""]
20276#[doc = "ID: 44"]
20277#[derive(Debug, Clone, PartialEq)]
20278#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20279#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20280#[cfg_attr(feature = "ts", derive(TS))]
20281#[cfg_attr(feature = "ts", ts(export))]
20282pub struct MISSION_COUNT_DATA {
20283 #[doc = "Number of mission items in the sequence"]
20284 pub count: u16,
20285 #[doc = "System ID"]
20286 pub target_system: u8,
20287 #[doc = "Component ID"]
20288 pub target_component: u8,
20289 #[doc = "Mission type."]
20290 #[cfg_attr(feature = "serde", serde(default))]
20291 pub mission_type: MavMissionType,
20292 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
20293 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20294 pub opaque_id: u32,
20295}
20296impl MISSION_COUNT_DATA {
20297 pub const ENCODED_LEN: usize = 9usize;
20298 pub const DEFAULT: Self = Self {
20299 count: 0_u16,
20300 target_system: 0_u8,
20301 target_component: 0_u8,
20302 mission_type: MavMissionType::DEFAULT,
20303 opaque_id: 0_u32,
20304 };
20305 #[cfg(feature = "arbitrary")]
20306 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20307 use arbitrary::{Arbitrary, Unstructured};
20308 let mut buf = [0u8; 1024];
20309 rng.fill_bytes(&mut buf);
20310 let mut unstructured = Unstructured::new(&buf);
20311 Self::arbitrary(&mut unstructured).unwrap_or_default()
20312 }
20313}
20314impl Default for MISSION_COUNT_DATA {
20315 fn default() -> Self {
20316 Self::DEFAULT.clone()
20317 }
20318}
20319impl MessageData for MISSION_COUNT_DATA {
20320 type Message = MavMessage;
20321 const ID: u32 = 44u32;
20322 const NAME: &'static str = "MISSION_COUNT";
20323 const EXTRA_CRC: u8 = 221u8;
20324 const ENCODED_LEN: usize = 9usize;
20325 fn deser(
20326 _version: MavlinkVersion,
20327 __input: &[u8],
20328 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20329 let avail_len = __input.len();
20330 let mut payload_buf = [0; Self::ENCODED_LEN];
20331 let mut buf = if avail_len < Self::ENCODED_LEN {
20332 payload_buf[0..avail_len].copy_from_slice(__input);
20333 Bytes::new(&payload_buf)
20334 } else {
20335 Bytes::new(__input)
20336 };
20337 let mut __struct = Self::default();
20338 __struct.count = buf.get_u16_le()?;
20339 __struct.target_system = buf.get_u8()?;
20340 __struct.target_component = buf.get_u8()?;
20341 let tmp = buf.get_u8()?;
20342 __struct.mission_type =
20343 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20344 enum_type: "MavMissionType",
20345 value: tmp as u64,
20346 })?;
20347 __struct.opaque_id = buf.get_u32_le()?;
20348 Ok(__struct)
20349 }
20350 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20351 let mut __tmp = BytesMut::new(bytes);
20352 #[allow(clippy::absurd_extreme_comparisons)]
20353 #[allow(unused_comparisons)]
20354 if __tmp.remaining() < Self::ENCODED_LEN {
20355 panic!(
20356 "buffer is too small (need {} bytes, but got {})",
20357 Self::ENCODED_LEN,
20358 __tmp.remaining(),
20359 )
20360 }
20361 __tmp.put_u16_le(self.count);
20362 __tmp.put_u8(self.target_system);
20363 __tmp.put_u8(self.target_component);
20364 if matches!(version, MavlinkVersion::V2) {
20365 __tmp.put_u8(self.mission_type as u8);
20366 __tmp.put_u32_le(self.opaque_id);
20367 let len = __tmp.len();
20368 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20369 } else {
20370 __tmp.len()
20371 }
20372 }
20373}
20374#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
20375#[doc = ""]
20376#[doc = "ID: 42"]
20377#[derive(Debug, Clone, PartialEq)]
20378#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20379#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20380#[cfg_attr(feature = "ts", derive(TS))]
20381#[cfg_attr(feature = "ts", ts(export))]
20382pub struct MISSION_CURRENT_DATA {
20383 #[doc = "Sequence"]
20384 pub seq: u16,
20385 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
20386 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20387 pub total: u16,
20388 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
20389 #[cfg_attr(feature = "serde", serde(default))]
20390 pub mission_state: MissionState,
20391 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
20392 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20393 pub mission_mode: u8,
20394 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
20395 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20396 pub mission_id: u32,
20397 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
20398 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20399 pub fence_id: u32,
20400 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
20401 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20402 pub rally_points_id: u32,
20403}
20404impl MISSION_CURRENT_DATA {
20405 pub const ENCODED_LEN: usize = 18usize;
20406 pub const DEFAULT: Self = Self {
20407 seq: 0_u16,
20408 total: 0_u16,
20409 mission_state: MissionState::DEFAULT,
20410 mission_mode: 0_u8,
20411 mission_id: 0_u32,
20412 fence_id: 0_u32,
20413 rally_points_id: 0_u32,
20414 };
20415 #[cfg(feature = "arbitrary")]
20416 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20417 use arbitrary::{Arbitrary, Unstructured};
20418 let mut buf = [0u8; 1024];
20419 rng.fill_bytes(&mut buf);
20420 let mut unstructured = Unstructured::new(&buf);
20421 Self::arbitrary(&mut unstructured).unwrap_or_default()
20422 }
20423}
20424impl Default for MISSION_CURRENT_DATA {
20425 fn default() -> Self {
20426 Self::DEFAULT.clone()
20427 }
20428}
20429impl MessageData for MISSION_CURRENT_DATA {
20430 type Message = MavMessage;
20431 const ID: u32 = 42u32;
20432 const NAME: &'static str = "MISSION_CURRENT";
20433 const EXTRA_CRC: u8 = 28u8;
20434 const ENCODED_LEN: usize = 18usize;
20435 fn deser(
20436 _version: MavlinkVersion,
20437 __input: &[u8],
20438 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20439 let avail_len = __input.len();
20440 let mut payload_buf = [0; Self::ENCODED_LEN];
20441 let mut buf = if avail_len < Self::ENCODED_LEN {
20442 payload_buf[0..avail_len].copy_from_slice(__input);
20443 Bytes::new(&payload_buf)
20444 } else {
20445 Bytes::new(__input)
20446 };
20447 let mut __struct = Self::default();
20448 __struct.seq = buf.get_u16_le()?;
20449 __struct.total = buf.get_u16_le()?;
20450 let tmp = buf.get_u8()?;
20451 __struct.mission_state =
20452 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20453 enum_type: "MissionState",
20454 value: tmp as u64,
20455 })?;
20456 __struct.mission_mode = buf.get_u8()?;
20457 __struct.mission_id = buf.get_u32_le()?;
20458 __struct.fence_id = buf.get_u32_le()?;
20459 __struct.rally_points_id = buf.get_u32_le()?;
20460 Ok(__struct)
20461 }
20462 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20463 let mut __tmp = BytesMut::new(bytes);
20464 #[allow(clippy::absurd_extreme_comparisons)]
20465 #[allow(unused_comparisons)]
20466 if __tmp.remaining() < Self::ENCODED_LEN {
20467 panic!(
20468 "buffer is too small (need {} bytes, but got {})",
20469 Self::ENCODED_LEN,
20470 __tmp.remaining(),
20471 )
20472 }
20473 __tmp.put_u16_le(self.seq);
20474 if matches!(version, MavlinkVersion::V2) {
20475 __tmp.put_u16_le(self.total);
20476 __tmp.put_u8(self.mission_state as u8);
20477 __tmp.put_u8(self.mission_mode);
20478 __tmp.put_u32_le(self.mission_id);
20479 __tmp.put_u32_le(self.fence_id);
20480 __tmp.put_u32_le(self.rally_points_id);
20481 let len = __tmp.len();
20482 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20483 } else {
20484 __tmp.len()
20485 }
20486 }
20487}
20488#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
20489#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
20490#[doc = ""]
20491#[doc = "ID: 39"]
20492#[derive(Debug, Clone, PartialEq)]
20493#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20494#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20495#[cfg_attr(feature = "ts", derive(TS))]
20496#[cfg_attr(feature = "ts", ts(export))]
20497pub struct MISSION_ITEM_DATA {
20498 #[doc = "PARAM1, see MAV_CMD enum"]
20499 pub param1: f32,
20500 #[doc = "PARAM2, see MAV_CMD enum"]
20501 pub param2: f32,
20502 #[doc = "PARAM3, see MAV_CMD enum"]
20503 pub param3: f32,
20504 #[doc = "PARAM4, see MAV_CMD enum"]
20505 pub param4: f32,
20506 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
20507 pub x: f32,
20508 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
20509 pub y: f32,
20510 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
20511 pub z: f32,
20512 #[doc = "Sequence"]
20513 pub seq: u16,
20514 #[doc = "The scheduled action for the waypoint."]
20515 pub command: MavCmd,
20516 #[doc = "System ID"]
20517 pub target_system: u8,
20518 #[doc = "Component ID"]
20519 pub target_component: u8,
20520 #[doc = "The coordinate system of the waypoint."]
20521 pub frame: MavFrame,
20522 #[doc = "false:0, true:1"]
20523 pub current: u8,
20524 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
20525 pub autocontinue: u8,
20526 #[doc = "Mission type."]
20527 #[cfg_attr(feature = "serde", serde(default))]
20528 pub mission_type: MavMissionType,
20529}
20530impl MISSION_ITEM_DATA {
20531 pub const ENCODED_LEN: usize = 38usize;
20532 pub const DEFAULT: Self = Self {
20533 param1: 0.0_f32,
20534 param2: 0.0_f32,
20535 param3: 0.0_f32,
20536 param4: 0.0_f32,
20537 x: 0.0_f32,
20538 y: 0.0_f32,
20539 z: 0.0_f32,
20540 seq: 0_u16,
20541 command: MavCmd::DEFAULT,
20542 target_system: 0_u8,
20543 target_component: 0_u8,
20544 frame: MavFrame::DEFAULT,
20545 current: 0_u8,
20546 autocontinue: 0_u8,
20547 mission_type: MavMissionType::DEFAULT,
20548 };
20549 #[cfg(feature = "arbitrary")]
20550 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20551 use arbitrary::{Arbitrary, Unstructured};
20552 let mut buf = [0u8; 1024];
20553 rng.fill_bytes(&mut buf);
20554 let mut unstructured = Unstructured::new(&buf);
20555 Self::arbitrary(&mut unstructured).unwrap_or_default()
20556 }
20557}
20558impl Default for MISSION_ITEM_DATA {
20559 fn default() -> Self {
20560 Self::DEFAULT.clone()
20561 }
20562}
20563impl MessageData for MISSION_ITEM_DATA {
20564 type Message = MavMessage;
20565 const ID: u32 = 39u32;
20566 const NAME: &'static str = "MISSION_ITEM";
20567 const EXTRA_CRC: u8 = 254u8;
20568 const ENCODED_LEN: usize = 38usize;
20569 fn deser(
20570 _version: MavlinkVersion,
20571 __input: &[u8],
20572 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20573 let avail_len = __input.len();
20574 let mut payload_buf = [0; Self::ENCODED_LEN];
20575 let mut buf = if avail_len < Self::ENCODED_LEN {
20576 payload_buf[0..avail_len].copy_from_slice(__input);
20577 Bytes::new(&payload_buf)
20578 } else {
20579 Bytes::new(__input)
20580 };
20581 let mut __struct = Self::default();
20582 __struct.param1 = buf.get_f32_le()?;
20583 __struct.param2 = buf.get_f32_le()?;
20584 __struct.param3 = buf.get_f32_le()?;
20585 __struct.param4 = buf.get_f32_le()?;
20586 __struct.x = buf.get_f32_le()?;
20587 __struct.y = buf.get_f32_le()?;
20588 __struct.z = buf.get_f32_le()?;
20589 __struct.seq = buf.get_u16_le()?;
20590 let tmp = buf.get_u16_le()?;
20591 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
20592 ::mavlink_core::error::ParserError::InvalidEnum {
20593 enum_type: "MavCmd",
20594 value: tmp as u64,
20595 },
20596 )?;
20597 __struct.target_system = buf.get_u8()?;
20598 __struct.target_component = buf.get_u8()?;
20599 let tmp = buf.get_u8()?;
20600 __struct.frame =
20601 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20602 enum_type: "MavFrame",
20603 value: tmp as u64,
20604 })?;
20605 __struct.current = buf.get_u8()?;
20606 __struct.autocontinue = buf.get_u8()?;
20607 let tmp = buf.get_u8()?;
20608 __struct.mission_type =
20609 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20610 enum_type: "MavMissionType",
20611 value: tmp as u64,
20612 })?;
20613 Ok(__struct)
20614 }
20615 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20616 let mut __tmp = BytesMut::new(bytes);
20617 #[allow(clippy::absurd_extreme_comparisons)]
20618 #[allow(unused_comparisons)]
20619 if __tmp.remaining() < Self::ENCODED_LEN {
20620 panic!(
20621 "buffer is too small (need {} bytes, but got {})",
20622 Self::ENCODED_LEN,
20623 __tmp.remaining(),
20624 )
20625 }
20626 __tmp.put_f32_le(self.param1);
20627 __tmp.put_f32_le(self.param2);
20628 __tmp.put_f32_le(self.param3);
20629 __tmp.put_f32_le(self.param4);
20630 __tmp.put_f32_le(self.x);
20631 __tmp.put_f32_le(self.y);
20632 __tmp.put_f32_le(self.z);
20633 __tmp.put_u16_le(self.seq);
20634 __tmp.put_u16_le(self.command as u16);
20635 __tmp.put_u8(self.target_system);
20636 __tmp.put_u8(self.target_component);
20637 __tmp.put_u8(self.frame as u8);
20638 __tmp.put_u8(self.current);
20639 __tmp.put_u8(self.autocontinue);
20640 if matches!(version, MavlinkVersion::V2) {
20641 __tmp.put_u8(self.mission_type as u8);
20642 let len = __tmp.len();
20643 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20644 } else {
20645 __tmp.len()
20646 }
20647 }
20648}
20649#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
20650#[doc = ""]
20651#[doc = "ID: 73"]
20652#[derive(Debug, Clone, PartialEq)]
20653#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20654#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20655#[cfg_attr(feature = "ts", derive(TS))]
20656#[cfg_attr(feature = "ts", ts(export))]
20657pub struct MISSION_ITEM_INT_DATA {
20658 #[doc = "PARAM1, see MAV_CMD enum"]
20659 pub param1: f32,
20660 #[doc = "PARAM2, see MAV_CMD enum"]
20661 pub param2: f32,
20662 #[doc = "PARAM3, see MAV_CMD enum"]
20663 pub param3: f32,
20664 #[doc = "PARAM4, see MAV_CMD enum"]
20665 pub param4: f32,
20666 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
20667 pub x: i32,
20668 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
20669 pub y: i32,
20670 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
20671 pub z: f32,
20672 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
20673 pub seq: u16,
20674 #[doc = "The scheduled action for the waypoint."]
20675 pub command: MavCmd,
20676 #[doc = "System ID"]
20677 pub target_system: u8,
20678 #[doc = "Component ID"]
20679 pub target_component: u8,
20680 #[doc = "The coordinate system of the waypoint."]
20681 pub frame: MavFrame,
20682 #[doc = "false:0, true:1"]
20683 pub current: u8,
20684 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
20685 pub autocontinue: u8,
20686 #[doc = "Mission type."]
20687 #[cfg_attr(feature = "serde", serde(default))]
20688 pub mission_type: MavMissionType,
20689}
20690impl MISSION_ITEM_INT_DATA {
20691 pub const ENCODED_LEN: usize = 38usize;
20692 pub const DEFAULT: Self = Self {
20693 param1: 0.0_f32,
20694 param2: 0.0_f32,
20695 param3: 0.0_f32,
20696 param4: 0.0_f32,
20697 x: 0_i32,
20698 y: 0_i32,
20699 z: 0.0_f32,
20700 seq: 0_u16,
20701 command: MavCmd::DEFAULT,
20702 target_system: 0_u8,
20703 target_component: 0_u8,
20704 frame: MavFrame::DEFAULT,
20705 current: 0_u8,
20706 autocontinue: 0_u8,
20707 mission_type: MavMissionType::DEFAULT,
20708 };
20709 #[cfg(feature = "arbitrary")]
20710 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20711 use arbitrary::{Arbitrary, Unstructured};
20712 let mut buf = [0u8; 1024];
20713 rng.fill_bytes(&mut buf);
20714 let mut unstructured = Unstructured::new(&buf);
20715 Self::arbitrary(&mut unstructured).unwrap_or_default()
20716 }
20717}
20718impl Default for MISSION_ITEM_INT_DATA {
20719 fn default() -> Self {
20720 Self::DEFAULT.clone()
20721 }
20722}
20723impl MessageData for MISSION_ITEM_INT_DATA {
20724 type Message = MavMessage;
20725 const ID: u32 = 73u32;
20726 const NAME: &'static str = "MISSION_ITEM_INT";
20727 const EXTRA_CRC: u8 = 38u8;
20728 const ENCODED_LEN: usize = 38usize;
20729 fn deser(
20730 _version: MavlinkVersion,
20731 __input: &[u8],
20732 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20733 let avail_len = __input.len();
20734 let mut payload_buf = [0; Self::ENCODED_LEN];
20735 let mut buf = if avail_len < Self::ENCODED_LEN {
20736 payload_buf[0..avail_len].copy_from_slice(__input);
20737 Bytes::new(&payload_buf)
20738 } else {
20739 Bytes::new(__input)
20740 };
20741 let mut __struct = Self::default();
20742 __struct.param1 = buf.get_f32_le()?;
20743 __struct.param2 = buf.get_f32_le()?;
20744 __struct.param3 = buf.get_f32_le()?;
20745 __struct.param4 = buf.get_f32_le()?;
20746 __struct.x = buf.get_i32_le()?;
20747 __struct.y = buf.get_i32_le()?;
20748 __struct.z = buf.get_f32_le()?;
20749 __struct.seq = buf.get_u16_le()?;
20750 let tmp = buf.get_u16_le()?;
20751 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
20752 ::mavlink_core::error::ParserError::InvalidEnum {
20753 enum_type: "MavCmd",
20754 value: tmp as u64,
20755 },
20756 )?;
20757 __struct.target_system = buf.get_u8()?;
20758 __struct.target_component = buf.get_u8()?;
20759 let tmp = buf.get_u8()?;
20760 __struct.frame =
20761 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20762 enum_type: "MavFrame",
20763 value: tmp as u64,
20764 })?;
20765 __struct.current = buf.get_u8()?;
20766 __struct.autocontinue = buf.get_u8()?;
20767 let tmp = buf.get_u8()?;
20768 __struct.mission_type =
20769 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20770 enum_type: "MavMissionType",
20771 value: tmp as u64,
20772 })?;
20773 Ok(__struct)
20774 }
20775 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20776 let mut __tmp = BytesMut::new(bytes);
20777 #[allow(clippy::absurd_extreme_comparisons)]
20778 #[allow(unused_comparisons)]
20779 if __tmp.remaining() < Self::ENCODED_LEN {
20780 panic!(
20781 "buffer is too small (need {} bytes, but got {})",
20782 Self::ENCODED_LEN,
20783 __tmp.remaining(),
20784 )
20785 }
20786 __tmp.put_f32_le(self.param1);
20787 __tmp.put_f32_le(self.param2);
20788 __tmp.put_f32_le(self.param3);
20789 __tmp.put_f32_le(self.param4);
20790 __tmp.put_i32_le(self.x);
20791 __tmp.put_i32_le(self.y);
20792 __tmp.put_f32_le(self.z);
20793 __tmp.put_u16_le(self.seq);
20794 __tmp.put_u16_le(self.command as u16);
20795 __tmp.put_u8(self.target_system);
20796 __tmp.put_u8(self.target_component);
20797 __tmp.put_u8(self.frame as u8);
20798 __tmp.put_u8(self.current);
20799 __tmp.put_u8(self.autocontinue);
20800 if matches!(version, MavlinkVersion::V2) {
20801 __tmp.put_u8(self.mission_type as u8);
20802 let len = __tmp.len();
20803 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20804 } else {
20805 __tmp.len()
20806 }
20807 }
20808}
20809#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
20810#[doc = ""]
20811#[doc = "ID: 46"]
20812#[derive(Debug, Clone, PartialEq)]
20813#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20814#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20815#[cfg_attr(feature = "ts", derive(TS))]
20816#[cfg_attr(feature = "ts", ts(export))]
20817pub struct MISSION_ITEM_REACHED_DATA {
20818 #[doc = "Sequence"]
20819 pub seq: u16,
20820}
20821impl MISSION_ITEM_REACHED_DATA {
20822 pub const ENCODED_LEN: usize = 2usize;
20823 pub const DEFAULT: Self = Self { seq: 0_u16 };
20824 #[cfg(feature = "arbitrary")]
20825 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20826 use arbitrary::{Arbitrary, Unstructured};
20827 let mut buf = [0u8; 1024];
20828 rng.fill_bytes(&mut buf);
20829 let mut unstructured = Unstructured::new(&buf);
20830 Self::arbitrary(&mut unstructured).unwrap_or_default()
20831 }
20832}
20833impl Default for MISSION_ITEM_REACHED_DATA {
20834 fn default() -> Self {
20835 Self::DEFAULT.clone()
20836 }
20837}
20838impl MessageData for MISSION_ITEM_REACHED_DATA {
20839 type Message = MavMessage;
20840 const ID: u32 = 46u32;
20841 const NAME: &'static str = "MISSION_ITEM_REACHED";
20842 const EXTRA_CRC: u8 = 11u8;
20843 const ENCODED_LEN: usize = 2usize;
20844 fn deser(
20845 _version: MavlinkVersion,
20846 __input: &[u8],
20847 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20848 let avail_len = __input.len();
20849 let mut payload_buf = [0; Self::ENCODED_LEN];
20850 let mut buf = if avail_len < Self::ENCODED_LEN {
20851 payload_buf[0..avail_len].copy_from_slice(__input);
20852 Bytes::new(&payload_buf)
20853 } else {
20854 Bytes::new(__input)
20855 };
20856 let mut __struct = Self::default();
20857 __struct.seq = buf.get_u16_le()?;
20858 Ok(__struct)
20859 }
20860 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20861 let mut __tmp = BytesMut::new(bytes);
20862 #[allow(clippy::absurd_extreme_comparisons)]
20863 #[allow(unused_comparisons)]
20864 if __tmp.remaining() < Self::ENCODED_LEN {
20865 panic!(
20866 "buffer is too small (need {} bytes, but got {})",
20867 Self::ENCODED_LEN,
20868 __tmp.remaining(),
20869 )
20870 }
20871 __tmp.put_u16_le(self.seq);
20872 if matches!(version, MavlinkVersion::V2) {
20873 let len = __tmp.len();
20874 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20875 } else {
20876 __tmp.len()
20877 }
20878 }
20879}
20880#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
20881#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
20882#[doc = ""]
20883#[doc = "ID: 40"]
20884#[derive(Debug, Clone, PartialEq)]
20885#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20886#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20887#[cfg_attr(feature = "ts", derive(TS))]
20888#[cfg_attr(feature = "ts", ts(export))]
20889pub struct MISSION_REQUEST_DATA {
20890 #[doc = "Sequence"]
20891 pub seq: u16,
20892 #[doc = "System ID"]
20893 pub target_system: u8,
20894 #[doc = "Component ID"]
20895 pub target_component: u8,
20896 #[doc = "Mission type."]
20897 #[cfg_attr(feature = "serde", serde(default))]
20898 pub mission_type: MavMissionType,
20899}
20900impl MISSION_REQUEST_DATA {
20901 pub const ENCODED_LEN: usize = 5usize;
20902 pub const DEFAULT: Self = Self {
20903 seq: 0_u16,
20904 target_system: 0_u8,
20905 target_component: 0_u8,
20906 mission_type: MavMissionType::DEFAULT,
20907 };
20908 #[cfg(feature = "arbitrary")]
20909 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20910 use arbitrary::{Arbitrary, Unstructured};
20911 let mut buf = [0u8; 1024];
20912 rng.fill_bytes(&mut buf);
20913 let mut unstructured = Unstructured::new(&buf);
20914 Self::arbitrary(&mut unstructured).unwrap_or_default()
20915 }
20916}
20917impl Default for MISSION_REQUEST_DATA {
20918 fn default() -> Self {
20919 Self::DEFAULT.clone()
20920 }
20921}
20922impl MessageData for MISSION_REQUEST_DATA {
20923 type Message = MavMessage;
20924 const ID: u32 = 40u32;
20925 const NAME: &'static str = "MISSION_REQUEST";
20926 const EXTRA_CRC: u8 = 230u8;
20927 const ENCODED_LEN: usize = 5usize;
20928 fn deser(
20929 _version: MavlinkVersion,
20930 __input: &[u8],
20931 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20932 let avail_len = __input.len();
20933 let mut payload_buf = [0; Self::ENCODED_LEN];
20934 let mut buf = if avail_len < Self::ENCODED_LEN {
20935 payload_buf[0..avail_len].copy_from_slice(__input);
20936 Bytes::new(&payload_buf)
20937 } else {
20938 Bytes::new(__input)
20939 };
20940 let mut __struct = Self::default();
20941 __struct.seq = buf.get_u16_le()?;
20942 __struct.target_system = buf.get_u8()?;
20943 __struct.target_component = buf.get_u8()?;
20944 let tmp = buf.get_u8()?;
20945 __struct.mission_type =
20946 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20947 enum_type: "MavMissionType",
20948 value: tmp as u64,
20949 })?;
20950 Ok(__struct)
20951 }
20952 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20953 let mut __tmp = BytesMut::new(bytes);
20954 #[allow(clippy::absurd_extreme_comparisons)]
20955 #[allow(unused_comparisons)]
20956 if __tmp.remaining() < Self::ENCODED_LEN {
20957 panic!(
20958 "buffer is too small (need {} bytes, but got {})",
20959 Self::ENCODED_LEN,
20960 __tmp.remaining(),
20961 )
20962 }
20963 __tmp.put_u16_le(self.seq);
20964 __tmp.put_u8(self.target_system);
20965 __tmp.put_u8(self.target_component);
20966 if matches!(version, MavlinkVersion::V2) {
20967 __tmp.put_u8(self.mission_type as u8);
20968 let len = __tmp.len();
20969 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20970 } else {
20971 __tmp.len()
20972 }
20973 }
20974}
20975#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
20976#[doc = ""]
20977#[doc = "ID: 51"]
20978#[derive(Debug, Clone, PartialEq)]
20979#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20980#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20981#[cfg_attr(feature = "ts", derive(TS))]
20982#[cfg_attr(feature = "ts", ts(export))]
20983pub struct MISSION_REQUEST_INT_DATA {
20984 #[doc = "Sequence"]
20985 pub seq: u16,
20986 #[doc = "System ID"]
20987 pub target_system: u8,
20988 #[doc = "Component ID"]
20989 pub target_component: u8,
20990 #[doc = "Mission type."]
20991 #[cfg_attr(feature = "serde", serde(default))]
20992 pub mission_type: MavMissionType,
20993}
20994impl MISSION_REQUEST_INT_DATA {
20995 pub const ENCODED_LEN: usize = 5usize;
20996 pub const DEFAULT: Self = Self {
20997 seq: 0_u16,
20998 target_system: 0_u8,
20999 target_component: 0_u8,
21000 mission_type: MavMissionType::DEFAULT,
21001 };
21002 #[cfg(feature = "arbitrary")]
21003 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21004 use arbitrary::{Arbitrary, Unstructured};
21005 let mut buf = [0u8; 1024];
21006 rng.fill_bytes(&mut buf);
21007 let mut unstructured = Unstructured::new(&buf);
21008 Self::arbitrary(&mut unstructured).unwrap_or_default()
21009 }
21010}
21011impl Default for MISSION_REQUEST_INT_DATA {
21012 fn default() -> Self {
21013 Self::DEFAULT.clone()
21014 }
21015}
21016impl MessageData for MISSION_REQUEST_INT_DATA {
21017 type Message = MavMessage;
21018 const ID: u32 = 51u32;
21019 const NAME: &'static str = "MISSION_REQUEST_INT";
21020 const EXTRA_CRC: u8 = 196u8;
21021 const ENCODED_LEN: usize = 5usize;
21022 fn deser(
21023 _version: MavlinkVersion,
21024 __input: &[u8],
21025 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21026 let avail_len = __input.len();
21027 let mut payload_buf = [0; Self::ENCODED_LEN];
21028 let mut buf = if avail_len < Self::ENCODED_LEN {
21029 payload_buf[0..avail_len].copy_from_slice(__input);
21030 Bytes::new(&payload_buf)
21031 } else {
21032 Bytes::new(__input)
21033 };
21034 let mut __struct = Self::default();
21035 __struct.seq = buf.get_u16_le()?;
21036 __struct.target_system = buf.get_u8()?;
21037 __struct.target_component = buf.get_u8()?;
21038 let tmp = buf.get_u8()?;
21039 __struct.mission_type =
21040 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21041 enum_type: "MavMissionType",
21042 value: tmp as u64,
21043 })?;
21044 Ok(__struct)
21045 }
21046 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21047 let mut __tmp = BytesMut::new(bytes);
21048 #[allow(clippy::absurd_extreme_comparisons)]
21049 #[allow(unused_comparisons)]
21050 if __tmp.remaining() < Self::ENCODED_LEN {
21051 panic!(
21052 "buffer is too small (need {} bytes, but got {})",
21053 Self::ENCODED_LEN,
21054 __tmp.remaining(),
21055 )
21056 }
21057 __tmp.put_u16_le(self.seq);
21058 __tmp.put_u8(self.target_system);
21059 __tmp.put_u8(self.target_component);
21060 if matches!(version, MavlinkVersion::V2) {
21061 __tmp.put_u8(self.mission_type as u8);
21062 let len = __tmp.len();
21063 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21064 } else {
21065 __tmp.len()
21066 }
21067 }
21068}
21069#[doc = "Request the overall list of mission items from the system/component."]
21070#[doc = ""]
21071#[doc = "ID: 43"]
21072#[derive(Debug, Clone, PartialEq)]
21073#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21074#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21075#[cfg_attr(feature = "ts", derive(TS))]
21076#[cfg_attr(feature = "ts", ts(export))]
21077pub struct MISSION_REQUEST_LIST_DATA {
21078 #[doc = "System ID"]
21079 pub target_system: u8,
21080 #[doc = "Component ID"]
21081 pub target_component: u8,
21082 #[doc = "Mission type."]
21083 #[cfg_attr(feature = "serde", serde(default))]
21084 pub mission_type: MavMissionType,
21085}
21086impl MISSION_REQUEST_LIST_DATA {
21087 pub const ENCODED_LEN: usize = 3usize;
21088 pub const DEFAULT: Self = Self {
21089 target_system: 0_u8,
21090 target_component: 0_u8,
21091 mission_type: MavMissionType::DEFAULT,
21092 };
21093 #[cfg(feature = "arbitrary")]
21094 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21095 use arbitrary::{Arbitrary, Unstructured};
21096 let mut buf = [0u8; 1024];
21097 rng.fill_bytes(&mut buf);
21098 let mut unstructured = Unstructured::new(&buf);
21099 Self::arbitrary(&mut unstructured).unwrap_or_default()
21100 }
21101}
21102impl Default for MISSION_REQUEST_LIST_DATA {
21103 fn default() -> Self {
21104 Self::DEFAULT.clone()
21105 }
21106}
21107impl MessageData for MISSION_REQUEST_LIST_DATA {
21108 type Message = MavMessage;
21109 const ID: u32 = 43u32;
21110 const NAME: &'static str = "MISSION_REQUEST_LIST";
21111 const EXTRA_CRC: u8 = 132u8;
21112 const ENCODED_LEN: usize = 3usize;
21113 fn deser(
21114 _version: MavlinkVersion,
21115 __input: &[u8],
21116 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21117 let avail_len = __input.len();
21118 let mut payload_buf = [0; Self::ENCODED_LEN];
21119 let mut buf = if avail_len < Self::ENCODED_LEN {
21120 payload_buf[0..avail_len].copy_from_slice(__input);
21121 Bytes::new(&payload_buf)
21122 } else {
21123 Bytes::new(__input)
21124 };
21125 let mut __struct = Self::default();
21126 __struct.target_system = buf.get_u8()?;
21127 __struct.target_component = buf.get_u8()?;
21128 let tmp = buf.get_u8()?;
21129 __struct.mission_type =
21130 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21131 enum_type: "MavMissionType",
21132 value: tmp as u64,
21133 })?;
21134 Ok(__struct)
21135 }
21136 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21137 let mut __tmp = BytesMut::new(bytes);
21138 #[allow(clippy::absurd_extreme_comparisons)]
21139 #[allow(unused_comparisons)]
21140 if __tmp.remaining() < Self::ENCODED_LEN {
21141 panic!(
21142 "buffer is too small (need {} bytes, but got {})",
21143 Self::ENCODED_LEN,
21144 __tmp.remaining(),
21145 )
21146 }
21147 __tmp.put_u8(self.target_system);
21148 __tmp.put_u8(self.target_component);
21149 if matches!(version, MavlinkVersion::V2) {
21150 __tmp.put_u8(self.mission_type as u8);
21151 let len = __tmp.len();
21152 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21153 } else {
21154 __tmp.len()
21155 }
21156 }
21157}
21158#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
21159#[doc = ""]
21160#[doc = "ID: 37"]
21161#[derive(Debug, Clone, PartialEq)]
21162#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21163#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21164#[cfg_attr(feature = "ts", derive(TS))]
21165#[cfg_attr(feature = "ts", ts(export))]
21166pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
21167 #[doc = "Start index"]
21168 pub start_index: i16,
21169 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
21170 pub end_index: i16,
21171 #[doc = "System ID"]
21172 pub target_system: u8,
21173 #[doc = "Component ID"]
21174 pub target_component: u8,
21175 #[doc = "Mission type."]
21176 #[cfg_attr(feature = "serde", serde(default))]
21177 pub mission_type: MavMissionType,
21178}
21179impl MISSION_REQUEST_PARTIAL_LIST_DATA {
21180 pub const ENCODED_LEN: usize = 7usize;
21181 pub const DEFAULT: Self = Self {
21182 start_index: 0_i16,
21183 end_index: 0_i16,
21184 target_system: 0_u8,
21185 target_component: 0_u8,
21186 mission_type: MavMissionType::DEFAULT,
21187 };
21188 #[cfg(feature = "arbitrary")]
21189 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21190 use arbitrary::{Arbitrary, Unstructured};
21191 let mut buf = [0u8; 1024];
21192 rng.fill_bytes(&mut buf);
21193 let mut unstructured = Unstructured::new(&buf);
21194 Self::arbitrary(&mut unstructured).unwrap_or_default()
21195 }
21196}
21197impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
21198 fn default() -> Self {
21199 Self::DEFAULT.clone()
21200 }
21201}
21202impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
21203 type Message = MavMessage;
21204 const ID: u32 = 37u32;
21205 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
21206 const EXTRA_CRC: u8 = 212u8;
21207 const ENCODED_LEN: usize = 7usize;
21208 fn deser(
21209 _version: MavlinkVersion,
21210 __input: &[u8],
21211 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21212 let avail_len = __input.len();
21213 let mut payload_buf = [0; Self::ENCODED_LEN];
21214 let mut buf = if avail_len < Self::ENCODED_LEN {
21215 payload_buf[0..avail_len].copy_from_slice(__input);
21216 Bytes::new(&payload_buf)
21217 } else {
21218 Bytes::new(__input)
21219 };
21220 let mut __struct = Self::default();
21221 __struct.start_index = buf.get_i16_le()?;
21222 __struct.end_index = buf.get_i16_le()?;
21223 __struct.target_system = buf.get_u8()?;
21224 __struct.target_component = buf.get_u8()?;
21225 let tmp = buf.get_u8()?;
21226 __struct.mission_type =
21227 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21228 enum_type: "MavMissionType",
21229 value: tmp as u64,
21230 })?;
21231 Ok(__struct)
21232 }
21233 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21234 let mut __tmp = BytesMut::new(bytes);
21235 #[allow(clippy::absurd_extreme_comparisons)]
21236 #[allow(unused_comparisons)]
21237 if __tmp.remaining() < Self::ENCODED_LEN {
21238 panic!(
21239 "buffer is too small (need {} bytes, but got {})",
21240 Self::ENCODED_LEN,
21241 __tmp.remaining(),
21242 )
21243 }
21244 __tmp.put_i16_le(self.start_index);
21245 __tmp.put_i16_le(self.end_index);
21246 __tmp.put_u8(self.target_system);
21247 __tmp.put_u8(self.target_component);
21248 if matches!(version, MavlinkVersion::V2) {
21249 __tmp.put_u8(self.mission_type as u8);
21250 let len = __tmp.len();
21251 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21252 } else {
21253 __tmp.len()
21254 }
21255 }
21256}
21257#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
21258#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
21259#[doc = ""]
21260#[doc = "ID: 41"]
21261#[derive(Debug, Clone, PartialEq)]
21262#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21263#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21264#[cfg_attr(feature = "ts", derive(TS))]
21265#[cfg_attr(feature = "ts", ts(export))]
21266pub struct MISSION_SET_CURRENT_DATA {
21267 #[doc = "Sequence"]
21268 pub seq: u16,
21269 #[doc = "System ID"]
21270 pub target_system: u8,
21271 #[doc = "Component ID"]
21272 pub target_component: u8,
21273}
21274impl MISSION_SET_CURRENT_DATA {
21275 pub const ENCODED_LEN: usize = 4usize;
21276 pub const DEFAULT: Self = Self {
21277 seq: 0_u16,
21278 target_system: 0_u8,
21279 target_component: 0_u8,
21280 };
21281 #[cfg(feature = "arbitrary")]
21282 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21283 use arbitrary::{Arbitrary, Unstructured};
21284 let mut buf = [0u8; 1024];
21285 rng.fill_bytes(&mut buf);
21286 let mut unstructured = Unstructured::new(&buf);
21287 Self::arbitrary(&mut unstructured).unwrap_or_default()
21288 }
21289}
21290impl Default for MISSION_SET_CURRENT_DATA {
21291 fn default() -> Self {
21292 Self::DEFAULT.clone()
21293 }
21294}
21295impl MessageData for MISSION_SET_CURRENT_DATA {
21296 type Message = MavMessage;
21297 const ID: u32 = 41u32;
21298 const NAME: &'static str = "MISSION_SET_CURRENT";
21299 const EXTRA_CRC: u8 = 28u8;
21300 const ENCODED_LEN: usize = 4usize;
21301 fn deser(
21302 _version: MavlinkVersion,
21303 __input: &[u8],
21304 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21305 let avail_len = __input.len();
21306 let mut payload_buf = [0; Self::ENCODED_LEN];
21307 let mut buf = if avail_len < Self::ENCODED_LEN {
21308 payload_buf[0..avail_len].copy_from_slice(__input);
21309 Bytes::new(&payload_buf)
21310 } else {
21311 Bytes::new(__input)
21312 };
21313 let mut __struct = Self::default();
21314 __struct.seq = buf.get_u16_le()?;
21315 __struct.target_system = buf.get_u8()?;
21316 __struct.target_component = buf.get_u8()?;
21317 Ok(__struct)
21318 }
21319 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21320 let mut __tmp = BytesMut::new(bytes);
21321 #[allow(clippy::absurd_extreme_comparisons)]
21322 #[allow(unused_comparisons)]
21323 if __tmp.remaining() < Self::ENCODED_LEN {
21324 panic!(
21325 "buffer is too small (need {} bytes, but got {})",
21326 Self::ENCODED_LEN,
21327 __tmp.remaining(),
21328 )
21329 }
21330 __tmp.put_u16_le(self.seq);
21331 __tmp.put_u8(self.target_system);
21332 __tmp.put_u8(self.target_component);
21333 if matches!(version, MavlinkVersion::V2) {
21334 let len = __tmp.len();
21335 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21336 } else {
21337 __tmp.len()
21338 }
21339 }
21340}
21341#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
21342#[doc = ""]
21343#[doc = "ID: 38"]
21344#[derive(Debug, Clone, PartialEq)]
21345#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21346#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21347#[cfg_attr(feature = "ts", derive(TS))]
21348#[cfg_attr(feature = "ts", ts(export))]
21349pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
21350 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
21351 pub start_index: i16,
21352 #[doc = "End index, equal or greater than start index."]
21353 pub end_index: i16,
21354 #[doc = "System ID"]
21355 pub target_system: u8,
21356 #[doc = "Component ID"]
21357 pub target_component: u8,
21358 #[doc = "Mission type."]
21359 #[cfg_attr(feature = "serde", serde(default))]
21360 pub mission_type: MavMissionType,
21361}
21362impl MISSION_WRITE_PARTIAL_LIST_DATA {
21363 pub const ENCODED_LEN: usize = 7usize;
21364 pub const DEFAULT: Self = Self {
21365 start_index: 0_i16,
21366 end_index: 0_i16,
21367 target_system: 0_u8,
21368 target_component: 0_u8,
21369 mission_type: MavMissionType::DEFAULT,
21370 };
21371 #[cfg(feature = "arbitrary")]
21372 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21373 use arbitrary::{Arbitrary, Unstructured};
21374 let mut buf = [0u8; 1024];
21375 rng.fill_bytes(&mut buf);
21376 let mut unstructured = Unstructured::new(&buf);
21377 Self::arbitrary(&mut unstructured).unwrap_or_default()
21378 }
21379}
21380impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
21381 fn default() -> Self {
21382 Self::DEFAULT.clone()
21383 }
21384}
21385impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
21386 type Message = MavMessage;
21387 const ID: u32 = 38u32;
21388 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
21389 const EXTRA_CRC: u8 = 9u8;
21390 const ENCODED_LEN: usize = 7usize;
21391 fn deser(
21392 _version: MavlinkVersion,
21393 __input: &[u8],
21394 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21395 let avail_len = __input.len();
21396 let mut payload_buf = [0; Self::ENCODED_LEN];
21397 let mut buf = if avail_len < Self::ENCODED_LEN {
21398 payload_buf[0..avail_len].copy_from_slice(__input);
21399 Bytes::new(&payload_buf)
21400 } else {
21401 Bytes::new(__input)
21402 };
21403 let mut __struct = Self::default();
21404 __struct.start_index = buf.get_i16_le()?;
21405 __struct.end_index = buf.get_i16_le()?;
21406 __struct.target_system = buf.get_u8()?;
21407 __struct.target_component = buf.get_u8()?;
21408 let tmp = buf.get_u8()?;
21409 __struct.mission_type =
21410 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21411 enum_type: "MavMissionType",
21412 value: tmp as u64,
21413 })?;
21414 Ok(__struct)
21415 }
21416 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21417 let mut __tmp = BytesMut::new(bytes);
21418 #[allow(clippy::absurd_extreme_comparisons)]
21419 #[allow(unused_comparisons)]
21420 if __tmp.remaining() < Self::ENCODED_LEN {
21421 panic!(
21422 "buffer is too small (need {} bytes, but got {})",
21423 Self::ENCODED_LEN,
21424 __tmp.remaining(),
21425 )
21426 }
21427 __tmp.put_i16_le(self.start_index);
21428 __tmp.put_i16_le(self.end_index);
21429 __tmp.put_u8(self.target_system);
21430 __tmp.put_u8(self.target_component);
21431 if matches!(version, MavlinkVersion::V2) {
21432 __tmp.put_u8(self.mission_type as u8);
21433 let len = __tmp.len();
21434 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21435 } else {
21436 __tmp.len()
21437 }
21438 }
21439}
21440#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
21441#[doc = "Orientation of a mount."]
21442#[doc = ""]
21443#[doc = "ID: 265"]
21444#[derive(Debug, Clone, PartialEq)]
21445#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21446#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21447#[cfg_attr(feature = "ts", derive(TS))]
21448#[cfg_attr(feature = "ts", ts(export))]
21449pub struct MOUNT_ORIENTATION_DATA {
21450 #[doc = "Timestamp (time since system boot)."]
21451 pub time_boot_ms: u32,
21452 #[doc = "Roll in global frame (set to NaN for invalid)."]
21453 pub roll: f32,
21454 #[doc = "Pitch in global frame (set to NaN for invalid)."]
21455 pub pitch: f32,
21456 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
21457 pub yaw: f32,
21458 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
21459 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21460 pub yaw_absolute: f32,
21461}
21462impl MOUNT_ORIENTATION_DATA {
21463 pub const ENCODED_LEN: usize = 20usize;
21464 pub const DEFAULT: Self = Self {
21465 time_boot_ms: 0_u32,
21466 roll: 0.0_f32,
21467 pitch: 0.0_f32,
21468 yaw: 0.0_f32,
21469 yaw_absolute: 0.0_f32,
21470 };
21471 #[cfg(feature = "arbitrary")]
21472 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21473 use arbitrary::{Arbitrary, Unstructured};
21474 let mut buf = [0u8; 1024];
21475 rng.fill_bytes(&mut buf);
21476 let mut unstructured = Unstructured::new(&buf);
21477 Self::arbitrary(&mut unstructured).unwrap_or_default()
21478 }
21479}
21480impl Default for MOUNT_ORIENTATION_DATA {
21481 fn default() -> Self {
21482 Self::DEFAULT.clone()
21483 }
21484}
21485impl MessageData for MOUNT_ORIENTATION_DATA {
21486 type Message = MavMessage;
21487 const ID: u32 = 265u32;
21488 const NAME: &'static str = "MOUNT_ORIENTATION";
21489 const EXTRA_CRC: u8 = 26u8;
21490 const ENCODED_LEN: usize = 20usize;
21491 fn deser(
21492 _version: MavlinkVersion,
21493 __input: &[u8],
21494 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21495 let avail_len = __input.len();
21496 let mut payload_buf = [0; Self::ENCODED_LEN];
21497 let mut buf = if avail_len < Self::ENCODED_LEN {
21498 payload_buf[0..avail_len].copy_from_slice(__input);
21499 Bytes::new(&payload_buf)
21500 } else {
21501 Bytes::new(__input)
21502 };
21503 let mut __struct = Self::default();
21504 __struct.time_boot_ms = buf.get_u32_le()?;
21505 __struct.roll = buf.get_f32_le()?;
21506 __struct.pitch = buf.get_f32_le()?;
21507 __struct.yaw = buf.get_f32_le()?;
21508 __struct.yaw_absolute = buf.get_f32_le()?;
21509 Ok(__struct)
21510 }
21511 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21512 let mut __tmp = BytesMut::new(bytes);
21513 #[allow(clippy::absurd_extreme_comparisons)]
21514 #[allow(unused_comparisons)]
21515 if __tmp.remaining() < Self::ENCODED_LEN {
21516 panic!(
21517 "buffer is too small (need {} bytes, but got {})",
21518 Self::ENCODED_LEN,
21519 __tmp.remaining(),
21520 )
21521 }
21522 __tmp.put_u32_le(self.time_boot_ms);
21523 __tmp.put_f32_le(self.roll);
21524 __tmp.put_f32_le(self.pitch);
21525 __tmp.put_f32_le(self.yaw);
21526 if matches!(version, MavlinkVersion::V2) {
21527 __tmp.put_f32_le(self.yaw_absolute);
21528 let len = __tmp.len();
21529 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21530 } else {
21531 __tmp.len()
21532 }
21533 }
21534}
21535#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
21536#[doc = ""]
21537#[doc = "ID: 251"]
21538#[derive(Debug, Clone, PartialEq)]
21539#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21540#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21541#[cfg_attr(feature = "ts", derive(TS))]
21542#[cfg_attr(feature = "ts", ts(export))]
21543pub struct NAMED_VALUE_FLOAT_DATA {
21544 #[doc = "Timestamp (time since system boot)."]
21545 pub time_boot_ms: u32,
21546 #[doc = "Floating point value"]
21547 pub value: f32,
21548 #[doc = "Name of the debug variable"]
21549 #[cfg_attr(feature = "ts", ts(type = "string"))]
21550 pub name: CharArray<10>,
21551}
21552impl NAMED_VALUE_FLOAT_DATA {
21553 pub const ENCODED_LEN: usize = 18usize;
21554 pub const DEFAULT: Self = Self {
21555 time_boot_ms: 0_u32,
21556 value: 0.0_f32,
21557 name: CharArray::new([0_u8; 10usize]),
21558 };
21559 #[cfg(feature = "arbitrary")]
21560 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21561 use arbitrary::{Arbitrary, Unstructured};
21562 let mut buf = [0u8; 1024];
21563 rng.fill_bytes(&mut buf);
21564 let mut unstructured = Unstructured::new(&buf);
21565 Self::arbitrary(&mut unstructured).unwrap_or_default()
21566 }
21567}
21568impl Default for NAMED_VALUE_FLOAT_DATA {
21569 fn default() -> Self {
21570 Self::DEFAULT.clone()
21571 }
21572}
21573impl MessageData for NAMED_VALUE_FLOAT_DATA {
21574 type Message = MavMessage;
21575 const ID: u32 = 251u32;
21576 const NAME: &'static str = "NAMED_VALUE_FLOAT";
21577 const EXTRA_CRC: u8 = 170u8;
21578 const ENCODED_LEN: usize = 18usize;
21579 fn deser(
21580 _version: MavlinkVersion,
21581 __input: &[u8],
21582 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21583 let avail_len = __input.len();
21584 let mut payload_buf = [0; Self::ENCODED_LEN];
21585 let mut buf = if avail_len < Self::ENCODED_LEN {
21586 payload_buf[0..avail_len].copy_from_slice(__input);
21587 Bytes::new(&payload_buf)
21588 } else {
21589 Bytes::new(__input)
21590 };
21591 let mut __struct = Self::default();
21592 __struct.time_boot_ms = buf.get_u32_le()?;
21593 __struct.value = buf.get_f32_le()?;
21594 let mut tmp = [0_u8; 10usize];
21595 for v in &mut tmp {
21596 *v = buf.get_u8()?;
21597 }
21598 __struct.name = CharArray::new(tmp);
21599 Ok(__struct)
21600 }
21601 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21602 let mut __tmp = BytesMut::new(bytes);
21603 #[allow(clippy::absurd_extreme_comparisons)]
21604 #[allow(unused_comparisons)]
21605 if __tmp.remaining() < Self::ENCODED_LEN {
21606 panic!(
21607 "buffer is too small (need {} bytes, but got {})",
21608 Self::ENCODED_LEN,
21609 __tmp.remaining(),
21610 )
21611 }
21612 __tmp.put_u32_le(self.time_boot_ms);
21613 __tmp.put_f32_le(self.value);
21614 for val in &self.name {
21615 __tmp.put_u8(*val);
21616 }
21617 if matches!(version, MavlinkVersion::V2) {
21618 let len = __tmp.len();
21619 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21620 } else {
21621 __tmp.len()
21622 }
21623 }
21624}
21625#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
21626#[doc = ""]
21627#[doc = "ID: 252"]
21628#[derive(Debug, Clone, PartialEq)]
21629#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21630#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21631#[cfg_attr(feature = "ts", derive(TS))]
21632#[cfg_attr(feature = "ts", ts(export))]
21633pub struct NAMED_VALUE_INT_DATA {
21634 #[doc = "Timestamp (time since system boot)."]
21635 pub time_boot_ms: u32,
21636 #[doc = "Signed integer value"]
21637 pub value: i32,
21638 #[doc = "Name of the debug variable"]
21639 #[cfg_attr(feature = "ts", ts(type = "string"))]
21640 pub name: CharArray<10>,
21641}
21642impl NAMED_VALUE_INT_DATA {
21643 pub const ENCODED_LEN: usize = 18usize;
21644 pub const DEFAULT: Self = Self {
21645 time_boot_ms: 0_u32,
21646 value: 0_i32,
21647 name: CharArray::new([0_u8; 10usize]),
21648 };
21649 #[cfg(feature = "arbitrary")]
21650 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21651 use arbitrary::{Arbitrary, Unstructured};
21652 let mut buf = [0u8; 1024];
21653 rng.fill_bytes(&mut buf);
21654 let mut unstructured = Unstructured::new(&buf);
21655 Self::arbitrary(&mut unstructured).unwrap_or_default()
21656 }
21657}
21658impl Default for NAMED_VALUE_INT_DATA {
21659 fn default() -> Self {
21660 Self::DEFAULT.clone()
21661 }
21662}
21663impl MessageData for NAMED_VALUE_INT_DATA {
21664 type Message = MavMessage;
21665 const ID: u32 = 252u32;
21666 const NAME: &'static str = "NAMED_VALUE_INT";
21667 const EXTRA_CRC: u8 = 44u8;
21668 const ENCODED_LEN: usize = 18usize;
21669 fn deser(
21670 _version: MavlinkVersion,
21671 __input: &[u8],
21672 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21673 let avail_len = __input.len();
21674 let mut payload_buf = [0; Self::ENCODED_LEN];
21675 let mut buf = if avail_len < Self::ENCODED_LEN {
21676 payload_buf[0..avail_len].copy_from_slice(__input);
21677 Bytes::new(&payload_buf)
21678 } else {
21679 Bytes::new(__input)
21680 };
21681 let mut __struct = Self::default();
21682 __struct.time_boot_ms = buf.get_u32_le()?;
21683 __struct.value = buf.get_i32_le()?;
21684 let mut tmp = [0_u8; 10usize];
21685 for v in &mut tmp {
21686 *v = buf.get_u8()?;
21687 }
21688 __struct.name = CharArray::new(tmp);
21689 Ok(__struct)
21690 }
21691 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21692 let mut __tmp = BytesMut::new(bytes);
21693 #[allow(clippy::absurd_extreme_comparisons)]
21694 #[allow(unused_comparisons)]
21695 if __tmp.remaining() < Self::ENCODED_LEN {
21696 panic!(
21697 "buffer is too small (need {} bytes, but got {})",
21698 Self::ENCODED_LEN,
21699 __tmp.remaining(),
21700 )
21701 }
21702 __tmp.put_u32_le(self.time_boot_ms);
21703 __tmp.put_i32_le(self.value);
21704 for val in &self.name {
21705 __tmp.put_u8(*val);
21706 }
21707 if matches!(version, MavlinkVersion::V2) {
21708 let len = __tmp.len();
21709 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21710 } else {
21711 __tmp.len()
21712 }
21713 }
21714}
21715#[doc = "The state of the navigation and position controller."]
21716#[doc = ""]
21717#[doc = "ID: 62"]
21718#[derive(Debug, Clone, PartialEq)]
21719#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21720#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21721#[cfg_attr(feature = "ts", derive(TS))]
21722#[cfg_attr(feature = "ts", ts(export))]
21723pub struct NAV_CONTROLLER_OUTPUT_DATA {
21724 #[doc = "Current desired roll"]
21725 pub nav_roll: f32,
21726 #[doc = "Current desired pitch"]
21727 pub nav_pitch: f32,
21728 #[doc = "Current altitude error"]
21729 pub alt_error: f32,
21730 #[doc = "Current airspeed error"]
21731 pub aspd_error: f32,
21732 #[doc = "Current crosstrack error on x-y plane"]
21733 pub xtrack_error: f32,
21734 #[doc = "Current desired heading"]
21735 pub nav_bearing: i16,
21736 #[doc = "Bearing to current waypoint/target"]
21737 pub target_bearing: i16,
21738 #[doc = "Distance to active waypoint"]
21739 pub wp_dist: u16,
21740}
21741impl NAV_CONTROLLER_OUTPUT_DATA {
21742 pub const ENCODED_LEN: usize = 26usize;
21743 pub const DEFAULT: Self = Self {
21744 nav_roll: 0.0_f32,
21745 nav_pitch: 0.0_f32,
21746 alt_error: 0.0_f32,
21747 aspd_error: 0.0_f32,
21748 xtrack_error: 0.0_f32,
21749 nav_bearing: 0_i16,
21750 target_bearing: 0_i16,
21751 wp_dist: 0_u16,
21752 };
21753 #[cfg(feature = "arbitrary")]
21754 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21755 use arbitrary::{Arbitrary, Unstructured};
21756 let mut buf = [0u8; 1024];
21757 rng.fill_bytes(&mut buf);
21758 let mut unstructured = Unstructured::new(&buf);
21759 Self::arbitrary(&mut unstructured).unwrap_or_default()
21760 }
21761}
21762impl Default for NAV_CONTROLLER_OUTPUT_DATA {
21763 fn default() -> Self {
21764 Self::DEFAULT.clone()
21765 }
21766}
21767impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
21768 type Message = MavMessage;
21769 const ID: u32 = 62u32;
21770 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
21771 const EXTRA_CRC: u8 = 183u8;
21772 const ENCODED_LEN: usize = 26usize;
21773 fn deser(
21774 _version: MavlinkVersion,
21775 __input: &[u8],
21776 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21777 let avail_len = __input.len();
21778 let mut payload_buf = [0; Self::ENCODED_LEN];
21779 let mut buf = if avail_len < Self::ENCODED_LEN {
21780 payload_buf[0..avail_len].copy_from_slice(__input);
21781 Bytes::new(&payload_buf)
21782 } else {
21783 Bytes::new(__input)
21784 };
21785 let mut __struct = Self::default();
21786 __struct.nav_roll = buf.get_f32_le()?;
21787 __struct.nav_pitch = buf.get_f32_le()?;
21788 __struct.alt_error = buf.get_f32_le()?;
21789 __struct.aspd_error = buf.get_f32_le()?;
21790 __struct.xtrack_error = buf.get_f32_le()?;
21791 __struct.nav_bearing = buf.get_i16_le()?;
21792 __struct.target_bearing = buf.get_i16_le()?;
21793 __struct.wp_dist = buf.get_u16_le()?;
21794 Ok(__struct)
21795 }
21796 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21797 let mut __tmp = BytesMut::new(bytes);
21798 #[allow(clippy::absurd_extreme_comparisons)]
21799 #[allow(unused_comparisons)]
21800 if __tmp.remaining() < Self::ENCODED_LEN {
21801 panic!(
21802 "buffer is too small (need {} bytes, but got {})",
21803 Self::ENCODED_LEN,
21804 __tmp.remaining(),
21805 )
21806 }
21807 __tmp.put_f32_le(self.nav_roll);
21808 __tmp.put_f32_le(self.nav_pitch);
21809 __tmp.put_f32_le(self.alt_error);
21810 __tmp.put_f32_le(self.aspd_error);
21811 __tmp.put_f32_le(self.xtrack_error);
21812 __tmp.put_i16_le(self.nav_bearing);
21813 __tmp.put_i16_le(self.target_bearing);
21814 __tmp.put_u16_le(self.wp_dist);
21815 if matches!(version, MavlinkVersion::V2) {
21816 let len = __tmp.len();
21817 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21818 } else {
21819 __tmp.len()
21820 }
21821 }
21822}
21823#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
21824#[doc = ""]
21825#[doc = "ID: 330"]
21826#[derive(Debug, Clone, PartialEq)]
21827#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21828#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21829#[cfg_attr(feature = "ts", derive(TS))]
21830#[cfg_attr(feature = "ts", ts(export))]
21831pub struct OBSTACLE_DISTANCE_DATA {
21832 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21833 pub time_usec: u64,
21834 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
21835 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21836 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21837 pub distances: [u16; 72],
21838 #[doc = "Minimum distance the sensor can measure."]
21839 pub min_distance: u16,
21840 #[doc = "Maximum distance the sensor can measure."]
21841 pub max_distance: u16,
21842 #[doc = "Class id of the distance sensor type."]
21843 pub sensor_type: MavDistanceSensor,
21844 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
21845 pub increment: u8,
21846 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
21847 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21848 pub increment_f: f32,
21849 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
21850 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21851 pub angle_offset: f32,
21852 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
21853 #[cfg_attr(feature = "serde", serde(default))]
21854 pub frame: MavFrame,
21855}
21856impl OBSTACLE_DISTANCE_DATA {
21857 pub const ENCODED_LEN: usize = 167usize;
21858 pub const DEFAULT: Self = Self {
21859 time_usec: 0_u64,
21860 distances: [0_u16; 72usize],
21861 min_distance: 0_u16,
21862 max_distance: 0_u16,
21863 sensor_type: MavDistanceSensor::DEFAULT,
21864 increment: 0_u8,
21865 increment_f: 0.0_f32,
21866 angle_offset: 0.0_f32,
21867 frame: MavFrame::DEFAULT,
21868 };
21869 #[cfg(feature = "arbitrary")]
21870 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21871 use arbitrary::{Arbitrary, Unstructured};
21872 let mut buf = [0u8; 1024];
21873 rng.fill_bytes(&mut buf);
21874 let mut unstructured = Unstructured::new(&buf);
21875 Self::arbitrary(&mut unstructured).unwrap_or_default()
21876 }
21877}
21878impl Default for OBSTACLE_DISTANCE_DATA {
21879 fn default() -> Self {
21880 Self::DEFAULT.clone()
21881 }
21882}
21883impl MessageData for OBSTACLE_DISTANCE_DATA {
21884 type Message = MavMessage;
21885 const ID: u32 = 330u32;
21886 const NAME: &'static str = "OBSTACLE_DISTANCE";
21887 const EXTRA_CRC: u8 = 23u8;
21888 const ENCODED_LEN: usize = 167usize;
21889 fn deser(
21890 _version: MavlinkVersion,
21891 __input: &[u8],
21892 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21893 let avail_len = __input.len();
21894 let mut payload_buf = [0; Self::ENCODED_LEN];
21895 let mut buf = if avail_len < Self::ENCODED_LEN {
21896 payload_buf[0..avail_len].copy_from_slice(__input);
21897 Bytes::new(&payload_buf)
21898 } else {
21899 Bytes::new(__input)
21900 };
21901 let mut __struct = Self::default();
21902 __struct.time_usec = buf.get_u64_le()?;
21903 for v in &mut __struct.distances {
21904 let val = buf.get_u16_le()?;
21905 *v = val;
21906 }
21907 __struct.min_distance = buf.get_u16_le()?;
21908 __struct.max_distance = buf.get_u16_le()?;
21909 let tmp = buf.get_u8()?;
21910 __struct.sensor_type =
21911 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21912 enum_type: "MavDistanceSensor",
21913 value: tmp as u64,
21914 })?;
21915 __struct.increment = buf.get_u8()?;
21916 __struct.increment_f = buf.get_f32_le()?;
21917 __struct.angle_offset = buf.get_f32_le()?;
21918 let tmp = buf.get_u8()?;
21919 __struct.frame =
21920 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21921 enum_type: "MavFrame",
21922 value: tmp as u64,
21923 })?;
21924 Ok(__struct)
21925 }
21926 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21927 let mut __tmp = BytesMut::new(bytes);
21928 #[allow(clippy::absurd_extreme_comparisons)]
21929 #[allow(unused_comparisons)]
21930 if __tmp.remaining() < Self::ENCODED_LEN {
21931 panic!(
21932 "buffer is too small (need {} bytes, but got {})",
21933 Self::ENCODED_LEN,
21934 __tmp.remaining(),
21935 )
21936 }
21937 __tmp.put_u64_le(self.time_usec);
21938 for val in &self.distances {
21939 __tmp.put_u16_le(*val);
21940 }
21941 __tmp.put_u16_le(self.min_distance);
21942 __tmp.put_u16_le(self.max_distance);
21943 __tmp.put_u8(self.sensor_type as u8);
21944 __tmp.put_u8(self.increment);
21945 if matches!(version, MavlinkVersion::V2) {
21946 __tmp.put_f32_le(self.increment_f);
21947 __tmp.put_f32_le(self.angle_offset);
21948 __tmp.put_u8(self.frame as u8);
21949 let len = __tmp.len();
21950 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21951 } else {
21952 __tmp.len()
21953 }
21954 }
21955}
21956#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
21957#[doc = ""]
21958#[doc = "ID: 331"]
21959#[derive(Debug, Clone, PartialEq)]
21960#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21961#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21962#[cfg_attr(feature = "ts", derive(TS))]
21963#[cfg_attr(feature = "ts", ts(export))]
21964pub struct ODOMETRY_DATA {
21965 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21966 pub time_usec: u64,
21967 #[doc = "X Position"]
21968 pub x: f32,
21969 #[doc = "Y Position"]
21970 pub y: f32,
21971 #[doc = "Z Position"]
21972 pub z: f32,
21973 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
21974 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21975 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21976 pub q: [f32; 4],
21977 #[doc = "X linear speed"]
21978 pub vx: f32,
21979 #[doc = "Y linear speed"]
21980 pub vy: f32,
21981 #[doc = "Z linear speed"]
21982 pub vz: f32,
21983 #[doc = "Roll angular speed"]
21984 pub rollspeed: f32,
21985 #[doc = "Pitch angular speed"]
21986 pub pitchspeed: f32,
21987 #[doc = "Yaw angular speed"]
21988 pub yawspeed: f32,
21989 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21990 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21991 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21992 pub pose_covariance: [f32; 21],
21993 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21994 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21995 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21996 pub velocity_covariance: [f32; 21],
21997 #[doc = "Coordinate frame of reference for the pose data."]
21998 pub frame_id: MavFrame,
21999 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
22000 pub child_frame_id: MavFrame,
22001 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
22002 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22003 pub reset_counter: u8,
22004 #[doc = "Type of estimator that is providing the odometry."]
22005 #[cfg_attr(feature = "serde", serde(default))]
22006 pub estimator_type: MavEstimatorType,
22007 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
22008 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22009 pub quality: i8,
22010}
22011impl ODOMETRY_DATA {
22012 pub const ENCODED_LEN: usize = 233usize;
22013 pub const DEFAULT: Self = Self {
22014 time_usec: 0_u64,
22015 x: 0.0_f32,
22016 y: 0.0_f32,
22017 z: 0.0_f32,
22018 q: [0.0_f32; 4usize],
22019 vx: 0.0_f32,
22020 vy: 0.0_f32,
22021 vz: 0.0_f32,
22022 rollspeed: 0.0_f32,
22023 pitchspeed: 0.0_f32,
22024 yawspeed: 0.0_f32,
22025 pose_covariance: [0.0_f32; 21usize],
22026 velocity_covariance: [0.0_f32; 21usize],
22027 frame_id: MavFrame::DEFAULT,
22028 child_frame_id: MavFrame::DEFAULT,
22029 reset_counter: 0_u8,
22030 estimator_type: MavEstimatorType::DEFAULT,
22031 quality: 0_i8,
22032 };
22033 #[cfg(feature = "arbitrary")]
22034 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22035 use arbitrary::{Arbitrary, Unstructured};
22036 let mut buf = [0u8; 1024];
22037 rng.fill_bytes(&mut buf);
22038 let mut unstructured = Unstructured::new(&buf);
22039 Self::arbitrary(&mut unstructured).unwrap_or_default()
22040 }
22041}
22042impl Default for ODOMETRY_DATA {
22043 fn default() -> Self {
22044 Self::DEFAULT.clone()
22045 }
22046}
22047impl MessageData for ODOMETRY_DATA {
22048 type Message = MavMessage;
22049 const ID: u32 = 331u32;
22050 const NAME: &'static str = "ODOMETRY";
22051 const EXTRA_CRC: u8 = 91u8;
22052 const ENCODED_LEN: usize = 233usize;
22053 fn deser(
22054 _version: MavlinkVersion,
22055 __input: &[u8],
22056 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22057 let avail_len = __input.len();
22058 let mut payload_buf = [0; Self::ENCODED_LEN];
22059 let mut buf = if avail_len < Self::ENCODED_LEN {
22060 payload_buf[0..avail_len].copy_from_slice(__input);
22061 Bytes::new(&payload_buf)
22062 } else {
22063 Bytes::new(__input)
22064 };
22065 let mut __struct = Self::default();
22066 __struct.time_usec = buf.get_u64_le()?;
22067 __struct.x = buf.get_f32_le()?;
22068 __struct.y = buf.get_f32_le()?;
22069 __struct.z = buf.get_f32_le()?;
22070 for v in &mut __struct.q {
22071 let val = buf.get_f32_le()?;
22072 *v = val;
22073 }
22074 __struct.vx = buf.get_f32_le()?;
22075 __struct.vy = buf.get_f32_le()?;
22076 __struct.vz = buf.get_f32_le()?;
22077 __struct.rollspeed = buf.get_f32_le()?;
22078 __struct.pitchspeed = buf.get_f32_le()?;
22079 __struct.yawspeed = buf.get_f32_le()?;
22080 for v in &mut __struct.pose_covariance {
22081 let val = buf.get_f32_le()?;
22082 *v = val;
22083 }
22084 for v in &mut __struct.velocity_covariance {
22085 let val = buf.get_f32_le()?;
22086 *v = val;
22087 }
22088 let tmp = buf.get_u8()?;
22089 __struct.frame_id =
22090 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22091 enum_type: "MavFrame",
22092 value: tmp as u64,
22093 })?;
22094 let tmp = buf.get_u8()?;
22095 __struct.child_frame_id =
22096 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22097 enum_type: "MavFrame",
22098 value: tmp as u64,
22099 })?;
22100 __struct.reset_counter = buf.get_u8()?;
22101 let tmp = buf.get_u8()?;
22102 __struct.estimator_type =
22103 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22104 enum_type: "MavEstimatorType",
22105 value: tmp as u64,
22106 })?;
22107 __struct.quality = buf.get_i8()?;
22108 Ok(__struct)
22109 }
22110 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22111 let mut __tmp = BytesMut::new(bytes);
22112 #[allow(clippy::absurd_extreme_comparisons)]
22113 #[allow(unused_comparisons)]
22114 if __tmp.remaining() < Self::ENCODED_LEN {
22115 panic!(
22116 "buffer is too small (need {} bytes, but got {})",
22117 Self::ENCODED_LEN,
22118 __tmp.remaining(),
22119 )
22120 }
22121 __tmp.put_u64_le(self.time_usec);
22122 __tmp.put_f32_le(self.x);
22123 __tmp.put_f32_le(self.y);
22124 __tmp.put_f32_le(self.z);
22125 for val in &self.q {
22126 __tmp.put_f32_le(*val);
22127 }
22128 __tmp.put_f32_le(self.vx);
22129 __tmp.put_f32_le(self.vy);
22130 __tmp.put_f32_le(self.vz);
22131 __tmp.put_f32_le(self.rollspeed);
22132 __tmp.put_f32_le(self.pitchspeed);
22133 __tmp.put_f32_le(self.yawspeed);
22134 for val in &self.pose_covariance {
22135 __tmp.put_f32_le(*val);
22136 }
22137 for val in &self.velocity_covariance {
22138 __tmp.put_f32_le(*val);
22139 }
22140 __tmp.put_u8(self.frame_id as u8);
22141 __tmp.put_u8(self.child_frame_id as u8);
22142 if matches!(version, MavlinkVersion::V2) {
22143 __tmp.put_u8(self.reset_counter);
22144 __tmp.put_u8(self.estimator_type as u8);
22145 __tmp.put_i8(self.quality);
22146 let len = __tmp.len();
22147 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22148 } else {
22149 __tmp.len()
22150 }
22151 }
22152}
22153#[doc = "Hardware status sent by an onboard computer."]
22154#[doc = ""]
22155#[doc = "ID: 390"]
22156#[derive(Debug, Clone, PartialEq)]
22157#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22158#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22159#[cfg_attr(feature = "ts", derive(TS))]
22160#[cfg_attr(feature = "ts", ts(export))]
22161pub struct ONBOARD_COMPUTER_STATUS_DATA {
22162 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22163 pub time_usec: u64,
22164 #[doc = "Time since system boot."]
22165 pub uptime: u32,
22166 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
22167 pub ram_usage: u32,
22168 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
22169 pub ram_total: u32,
22170 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
22171 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22172 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22173 pub storage_type: [u32; 4],
22174 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
22175 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22176 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22177 pub storage_usage: [u32; 4],
22178 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
22179 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22180 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22181 pub storage_total: [u32; 4],
22182 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
22183 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22184 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22185 pub link_type: [u32; 6],
22186 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
22187 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22188 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22189 pub link_tx_rate: [u32; 6],
22190 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
22191 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22192 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22193 pub link_rx_rate: [u32; 6],
22194 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
22195 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22196 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22197 pub link_tx_max: [u32; 6],
22198 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
22199 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22200 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22201 pub link_rx_max: [u32; 6],
22202 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
22203 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22204 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22205 pub fan_speed: [i16; 4],
22206 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
22207 pub mavtype: u8,
22208 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
22209 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22210 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22211 pub cpu_cores: [u8; 8],
22212 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
22213 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22214 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22215 pub cpu_combined: [u8; 10],
22216 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
22217 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22218 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22219 pub gpu_cores: [u8; 4],
22220 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
22221 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22222 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22223 pub gpu_combined: [u8; 10],
22224 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
22225 pub temperature_board: i8,
22226 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
22227 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22228 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22229 pub temperature_core: [i8; 8],
22230}
22231impl ONBOARD_COMPUTER_STATUS_DATA {
22232 pub const ENCODED_LEN: usize = 238usize;
22233 pub const DEFAULT: Self = Self {
22234 time_usec: 0_u64,
22235 uptime: 0_u32,
22236 ram_usage: 0_u32,
22237 ram_total: 0_u32,
22238 storage_type: [0_u32; 4usize],
22239 storage_usage: [0_u32; 4usize],
22240 storage_total: [0_u32; 4usize],
22241 link_type: [0_u32; 6usize],
22242 link_tx_rate: [0_u32; 6usize],
22243 link_rx_rate: [0_u32; 6usize],
22244 link_tx_max: [0_u32; 6usize],
22245 link_rx_max: [0_u32; 6usize],
22246 fan_speed: [0_i16; 4usize],
22247 mavtype: 0_u8,
22248 cpu_cores: [0_u8; 8usize],
22249 cpu_combined: [0_u8; 10usize],
22250 gpu_cores: [0_u8; 4usize],
22251 gpu_combined: [0_u8; 10usize],
22252 temperature_board: 0_i8,
22253 temperature_core: [0_i8; 8usize],
22254 };
22255 #[cfg(feature = "arbitrary")]
22256 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22257 use arbitrary::{Arbitrary, Unstructured};
22258 let mut buf = [0u8; 1024];
22259 rng.fill_bytes(&mut buf);
22260 let mut unstructured = Unstructured::new(&buf);
22261 Self::arbitrary(&mut unstructured).unwrap_or_default()
22262 }
22263}
22264impl Default for ONBOARD_COMPUTER_STATUS_DATA {
22265 fn default() -> Self {
22266 Self::DEFAULT.clone()
22267 }
22268}
22269impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
22270 type Message = MavMessage;
22271 const ID: u32 = 390u32;
22272 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
22273 const EXTRA_CRC: u8 = 156u8;
22274 const ENCODED_LEN: usize = 238usize;
22275 fn deser(
22276 _version: MavlinkVersion,
22277 __input: &[u8],
22278 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22279 let avail_len = __input.len();
22280 let mut payload_buf = [0; Self::ENCODED_LEN];
22281 let mut buf = if avail_len < Self::ENCODED_LEN {
22282 payload_buf[0..avail_len].copy_from_slice(__input);
22283 Bytes::new(&payload_buf)
22284 } else {
22285 Bytes::new(__input)
22286 };
22287 let mut __struct = Self::default();
22288 __struct.time_usec = buf.get_u64_le()?;
22289 __struct.uptime = buf.get_u32_le()?;
22290 __struct.ram_usage = buf.get_u32_le()?;
22291 __struct.ram_total = buf.get_u32_le()?;
22292 for v in &mut __struct.storage_type {
22293 let val = buf.get_u32_le()?;
22294 *v = val;
22295 }
22296 for v in &mut __struct.storage_usage {
22297 let val = buf.get_u32_le()?;
22298 *v = val;
22299 }
22300 for v in &mut __struct.storage_total {
22301 let val = buf.get_u32_le()?;
22302 *v = val;
22303 }
22304 for v in &mut __struct.link_type {
22305 let val = buf.get_u32_le()?;
22306 *v = val;
22307 }
22308 for v in &mut __struct.link_tx_rate {
22309 let val = buf.get_u32_le()?;
22310 *v = val;
22311 }
22312 for v in &mut __struct.link_rx_rate {
22313 let val = buf.get_u32_le()?;
22314 *v = val;
22315 }
22316 for v in &mut __struct.link_tx_max {
22317 let val = buf.get_u32_le()?;
22318 *v = val;
22319 }
22320 for v in &mut __struct.link_rx_max {
22321 let val = buf.get_u32_le()?;
22322 *v = val;
22323 }
22324 for v in &mut __struct.fan_speed {
22325 let val = buf.get_i16_le()?;
22326 *v = val;
22327 }
22328 __struct.mavtype = buf.get_u8()?;
22329 for v in &mut __struct.cpu_cores {
22330 let val = buf.get_u8()?;
22331 *v = val;
22332 }
22333 for v in &mut __struct.cpu_combined {
22334 let val = buf.get_u8()?;
22335 *v = val;
22336 }
22337 for v in &mut __struct.gpu_cores {
22338 let val = buf.get_u8()?;
22339 *v = val;
22340 }
22341 for v in &mut __struct.gpu_combined {
22342 let val = buf.get_u8()?;
22343 *v = val;
22344 }
22345 __struct.temperature_board = buf.get_i8()?;
22346 for v in &mut __struct.temperature_core {
22347 let val = buf.get_i8()?;
22348 *v = val;
22349 }
22350 Ok(__struct)
22351 }
22352 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22353 let mut __tmp = BytesMut::new(bytes);
22354 #[allow(clippy::absurd_extreme_comparisons)]
22355 #[allow(unused_comparisons)]
22356 if __tmp.remaining() < Self::ENCODED_LEN {
22357 panic!(
22358 "buffer is too small (need {} bytes, but got {})",
22359 Self::ENCODED_LEN,
22360 __tmp.remaining(),
22361 )
22362 }
22363 __tmp.put_u64_le(self.time_usec);
22364 __tmp.put_u32_le(self.uptime);
22365 __tmp.put_u32_le(self.ram_usage);
22366 __tmp.put_u32_le(self.ram_total);
22367 for val in &self.storage_type {
22368 __tmp.put_u32_le(*val);
22369 }
22370 for val in &self.storage_usage {
22371 __tmp.put_u32_le(*val);
22372 }
22373 for val in &self.storage_total {
22374 __tmp.put_u32_le(*val);
22375 }
22376 for val in &self.link_type {
22377 __tmp.put_u32_le(*val);
22378 }
22379 for val in &self.link_tx_rate {
22380 __tmp.put_u32_le(*val);
22381 }
22382 for val in &self.link_rx_rate {
22383 __tmp.put_u32_le(*val);
22384 }
22385 for val in &self.link_tx_max {
22386 __tmp.put_u32_le(*val);
22387 }
22388 for val in &self.link_rx_max {
22389 __tmp.put_u32_le(*val);
22390 }
22391 for val in &self.fan_speed {
22392 __tmp.put_i16_le(*val);
22393 }
22394 __tmp.put_u8(self.mavtype);
22395 for val in &self.cpu_cores {
22396 __tmp.put_u8(*val);
22397 }
22398 for val in &self.cpu_combined {
22399 __tmp.put_u8(*val);
22400 }
22401 for val in &self.gpu_cores {
22402 __tmp.put_u8(*val);
22403 }
22404 for val in &self.gpu_combined {
22405 __tmp.put_u8(*val);
22406 }
22407 __tmp.put_i8(self.temperature_board);
22408 for val in &self.temperature_core {
22409 __tmp.put_i8(*val);
22410 }
22411 if matches!(version, MavlinkVersion::V2) {
22412 let len = __tmp.len();
22413 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22414 } else {
22415 __tmp.len()
22416 }
22417 }
22418}
22419#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
22420#[doc = ""]
22421#[doc = "ID: 12918"]
22422#[derive(Debug, Clone, PartialEq)]
22423#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22424#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22425#[cfg_attr(feature = "ts", derive(TS))]
22426#[cfg_attr(feature = "ts", ts(export))]
22427pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
22428 #[doc = "Status level indicating if arming is allowed."]
22429 pub status: MavOdidArmStatus,
22430 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
22431 #[cfg_attr(feature = "ts", ts(type = "string"))]
22432 pub error: CharArray<50>,
22433}
22434impl OPEN_DRONE_ID_ARM_STATUS_DATA {
22435 pub const ENCODED_LEN: usize = 51usize;
22436 pub const DEFAULT: Self = Self {
22437 status: MavOdidArmStatus::DEFAULT,
22438 error: CharArray::new([0_u8; 50usize]),
22439 };
22440 #[cfg(feature = "arbitrary")]
22441 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22442 use arbitrary::{Arbitrary, Unstructured};
22443 let mut buf = [0u8; 1024];
22444 rng.fill_bytes(&mut buf);
22445 let mut unstructured = Unstructured::new(&buf);
22446 Self::arbitrary(&mut unstructured).unwrap_or_default()
22447 }
22448}
22449impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
22450 fn default() -> Self {
22451 Self::DEFAULT.clone()
22452 }
22453}
22454impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
22455 type Message = MavMessage;
22456 const ID: u32 = 12918u32;
22457 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
22458 const EXTRA_CRC: u8 = 139u8;
22459 const ENCODED_LEN: usize = 51usize;
22460 fn deser(
22461 _version: MavlinkVersion,
22462 __input: &[u8],
22463 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22464 let avail_len = __input.len();
22465 let mut payload_buf = [0; Self::ENCODED_LEN];
22466 let mut buf = if avail_len < Self::ENCODED_LEN {
22467 payload_buf[0..avail_len].copy_from_slice(__input);
22468 Bytes::new(&payload_buf)
22469 } else {
22470 Bytes::new(__input)
22471 };
22472 let mut __struct = Self::default();
22473 let tmp = buf.get_u8()?;
22474 __struct.status =
22475 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22476 enum_type: "MavOdidArmStatus",
22477 value: tmp as u64,
22478 })?;
22479 let mut tmp = [0_u8; 50usize];
22480 for v in &mut tmp {
22481 *v = buf.get_u8()?;
22482 }
22483 __struct.error = CharArray::new(tmp);
22484 Ok(__struct)
22485 }
22486 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22487 let mut __tmp = BytesMut::new(bytes);
22488 #[allow(clippy::absurd_extreme_comparisons)]
22489 #[allow(unused_comparisons)]
22490 if __tmp.remaining() < Self::ENCODED_LEN {
22491 panic!(
22492 "buffer is too small (need {} bytes, but got {})",
22493 Self::ENCODED_LEN,
22494 __tmp.remaining(),
22495 )
22496 }
22497 __tmp.put_u8(self.status as u8);
22498 for val in &self.error {
22499 __tmp.put_u8(*val);
22500 }
22501 if matches!(version, MavlinkVersion::V2) {
22502 let len = __tmp.len();
22503 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22504 } else {
22505 __tmp.len()
22506 }
22507 }
22508}
22509#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
22510#[doc = ""]
22511#[doc = "ID: 12902"]
22512#[derive(Debug, Clone, PartialEq)]
22513#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22514#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22515#[cfg_attr(feature = "ts", derive(TS))]
22516#[cfg_attr(feature = "ts", ts(export))]
22517pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
22518 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22519 pub timestamp: u32,
22520 #[doc = "System ID (0 for broadcast)."]
22521 pub target_system: u8,
22522 #[doc = "Component ID (0 for broadcast)."]
22523 pub target_component: u8,
22524 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22525 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22526 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22527 pub id_or_mac: [u8; 20],
22528 #[doc = "Indicates the type of authentication."]
22529 pub authentication_type: MavOdidAuthType,
22530 #[doc = "Allowed range is 0 - 15."]
22531 pub data_page: u8,
22532 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
22533 pub last_page_index: u8,
22534 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
22535 pub length: u8,
22536 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
22537 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22538 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22539 pub authentication_data: [u8; 23],
22540}
22541impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
22542 pub const ENCODED_LEN: usize = 53usize;
22543 pub const DEFAULT: Self = Self {
22544 timestamp: 0_u32,
22545 target_system: 0_u8,
22546 target_component: 0_u8,
22547 id_or_mac: [0_u8; 20usize],
22548 authentication_type: MavOdidAuthType::DEFAULT,
22549 data_page: 0_u8,
22550 last_page_index: 0_u8,
22551 length: 0_u8,
22552 authentication_data: [0_u8; 23usize],
22553 };
22554 #[cfg(feature = "arbitrary")]
22555 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22556 use arbitrary::{Arbitrary, Unstructured};
22557 let mut buf = [0u8; 1024];
22558 rng.fill_bytes(&mut buf);
22559 let mut unstructured = Unstructured::new(&buf);
22560 Self::arbitrary(&mut unstructured).unwrap_or_default()
22561 }
22562}
22563impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
22564 fn default() -> Self {
22565 Self::DEFAULT.clone()
22566 }
22567}
22568impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
22569 type Message = MavMessage;
22570 const ID: u32 = 12902u32;
22571 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
22572 const EXTRA_CRC: u8 = 140u8;
22573 const ENCODED_LEN: usize = 53usize;
22574 fn deser(
22575 _version: MavlinkVersion,
22576 __input: &[u8],
22577 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22578 let avail_len = __input.len();
22579 let mut payload_buf = [0; Self::ENCODED_LEN];
22580 let mut buf = if avail_len < Self::ENCODED_LEN {
22581 payload_buf[0..avail_len].copy_from_slice(__input);
22582 Bytes::new(&payload_buf)
22583 } else {
22584 Bytes::new(__input)
22585 };
22586 let mut __struct = Self::default();
22587 __struct.timestamp = buf.get_u32_le()?;
22588 __struct.target_system = buf.get_u8()?;
22589 __struct.target_component = buf.get_u8()?;
22590 for v in &mut __struct.id_or_mac {
22591 let val = buf.get_u8()?;
22592 *v = val;
22593 }
22594 let tmp = buf.get_u8()?;
22595 __struct.authentication_type =
22596 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22597 enum_type: "MavOdidAuthType",
22598 value: tmp as u64,
22599 })?;
22600 __struct.data_page = buf.get_u8()?;
22601 __struct.last_page_index = buf.get_u8()?;
22602 __struct.length = buf.get_u8()?;
22603 for v in &mut __struct.authentication_data {
22604 let val = buf.get_u8()?;
22605 *v = val;
22606 }
22607 Ok(__struct)
22608 }
22609 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22610 let mut __tmp = BytesMut::new(bytes);
22611 #[allow(clippy::absurd_extreme_comparisons)]
22612 #[allow(unused_comparisons)]
22613 if __tmp.remaining() < Self::ENCODED_LEN {
22614 panic!(
22615 "buffer is too small (need {} bytes, but got {})",
22616 Self::ENCODED_LEN,
22617 __tmp.remaining(),
22618 )
22619 }
22620 __tmp.put_u32_le(self.timestamp);
22621 __tmp.put_u8(self.target_system);
22622 __tmp.put_u8(self.target_component);
22623 for val in &self.id_or_mac {
22624 __tmp.put_u8(*val);
22625 }
22626 __tmp.put_u8(self.authentication_type as u8);
22627 __tmp.put_u8(self.data_page);
22628 __tmp.put_u8(self.last_page_index);
22629 __tmp.put_u8(self.length);
22630 for val in &self.authentication_data {
22631 __tmp.put_u8(*val);
22632 }
22633 if matches!(version, MavlinkVersion::V2) {
22634 let len = __tmp.len();
22635 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22636 } else {
22637 __tmp.len()
22638 }
22639 }
22640}
22641#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
22642#[doc = ""]
22643#[doc = "ID: 12900"]
22644#[derive(Debug, Clone, PartialEq)]
22645#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22646#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22647#[cfg_attr(feature = "ts", derive(TS))]
22648#[cfg_attr(feature = "ts", ts(export))]
22649pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
22650 #[doc = "System ID (0 for broadcast)."]
22651 pub target_system: u8,
22652 #[doc = "Component ID (0 for broadcast)."]
22653 pub target_component: u8,
22654 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22655 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22656 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22657 pub id_or_mac: [u8; 20],
22658 #[doc = "Indicates the format for the uas_id field of this message."]
22659 pub id_type: MavOdidIdType,
22660 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
22661 pub ua_type: MavOdidUaType,
22662 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
22663 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22664 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22665 pub uas_id: [u8; 20],
22666}
22667impl OPEN_DRONE_ID_BASIC_ID_DATA {
22668 pub const ENCODED_LEN: usize = 44usize;
22669 pub const DEFAULT: Self = Self {
22670 target_system: 0_u8,
22671 target_component: 0_u8,
22672 id_or_mac: [0_u8; 20usize],
22673 id_type: MavOdidIdType::DEFAULT,
22674 ua_type: MavOdidUaType::DEFAULT,
22675 uas_id: [0_u8; 20usize],
22676 };
22677 #[cfg(feature = "arbitrary")]
22678 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22679 use arbitrary::{Arbitrary, Unstructured};
22680 let mut buf = [0u8; 1024];
22681 rng.fill_bytes(&mut buf);
22682 let mut unstructured = Unstructured::new(&buf);
22683 Self::arbitrary(&mut unstructured).unwrap_or_default()
22684 }
22685}
22686impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
22687 fn default() -> Self {
22688 Self::DEFAULT.clone()
22689 }
22690}
22691impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
22692 type Message = MavMessage;
22693 const ID: u32 = 12900u32;
22694 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
22695 const EXTRA_CRC: u8 = 114u8;
22696 const ENCODED_LEN: usize = 44usize;
22697 fn deser(
22698 _version: MavlinkVersion,
22699 __input: &[u8],
22700 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22701 let avail_len = __input.len();
22702 let mut payload_buf = [0; Self::ENCODED_LEN];
22703 let mut buf = if avail_len < Self::ENCODED_LEN {
22704 payload_buf[0..avail_len].copy_from_slice(__input);
22705 Bytes::new(&payload_buf)
22706 } else {
22707 Bytes::new(__input)
22708 };
22709 let mut __struct = Self::default();
22710 __struct.target_system = buf.get_u8()?;
22711 __struct.target_component = buf.get_u8()?;
22712 for v in &mut __struct.id_or_mac {
22713 let val = buf.get_u8()?;
22714 *v = val;
22715 }
22716 let tmp = buf.get_u8()?;
22717 __struct.id_type =
22718 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22719 enum_type: "MavOdidIdType",
22720 value: tmp as u64,
22721 })?;
22722 let tmp = buf.get_u8()?;
22723 __struct.ua_type =
22724 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22725 enum_type: "MavOdidUaType",
22726 value: tmp as u64,
22727 })?;
22728 for v in &mut __struct.uas_id {
22729 let val = buf.get_u8()?;
22730 *v = val;
22731 }
22732 Ok(__struct)
22733 }
22734 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22735 let mut __tmp = BytesMut::new(bytes);
22736 #[allow(clippy::absurd_extreme_comparisons)]
22737 #[allow(unused_comparisons)]
22738 if __tmp.remaining() < Self::ENCODED_LEN {
22739 panic!(
22740 "buffer is too small (need {} bytes, but got {})",
22741 Self::ENCODED_LEN,
22742 __tmp.remaining(),
22743 )
22744 }
22745 __tmp.put_u8(self.target_system);
22746 __tmp.put_u8(self.target_component);
22747 for val in &self.id_or_mac {
22748 __tmp.put_u8(*val);
22749 }
22750 __tmp.put_u8(self.id_type as u8);
22751 __tmp.put_u8(self.ua_type as u8);
22752 for val in &self.uas_id {
22753 __tmp.put_u8(*val);
22754 }
22755 if matches!(version, MavlinkVersion::V2) {
22756 let len = __tmp.len();
22757 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22758 } else {
22759 __tmp.len()
22760 }
22761 }
22762}
22763#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
22764#[doc = ""]
22765#[doc = "ID: 12901"]
22766#[derive(Debug, Clone, PartialEq)]
22767#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22768#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22769#[cfg_attr(feature = "ts", derive(TS))]
22770#[cfg_attr(feature = "ts", ts(export))]
22771pub struct OPEN_DRONE_ID_LOCATION_DATA {
22772 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22773 pub latitude: i32,
22774 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22775 pub longitude: i32,
22776 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
22777 pub altitude_barometric: f32,
22778 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
22779 pub altitude_geodetic: f32,
22780 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
22781 pub height: f32,
22782 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
22783 pub timestamp: f32,
22784 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
22785 pub direction: u16,
22786 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
22787 pub speed_horizontal: u16,
22788 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
22789 pub speed_vertical: i16,
22790 #[doc = "System ID (0 for broadcast)."]
22791 pub target_system: u8,
22792 #[doc = "Component ID (0 for broadcast)."]
22793 pub target_component: u8,
22794 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22795 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22796 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22797 pub id_or_mac: [u8; 20],
22798 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
22799 pub status: MavOdidStatus,
22800 #[doc = "Indicates the reference point for the height field."]
22801 pub height_reference: MavOdidHeightRef,
22802 #[doc = "The accuracy of the horizontal position."]
22803 pub horizontal_accuracy: MavOdidHorAcc,
22804 #[doc = "The accuracy of the vertical position."]
22805 pub vertical_accuracy: MavOdidVerAcc,
22806 #[doc = "The accuracy of the barometric altitude."]
22807 pub barometer_accuracy: MavOdidVerAcc,
22808 #[doc = "The accuracy of the horizontal and vertical speed."]
22809 pub speed_accuracy: MavOdidSpeedAcc,
22810 #[doc = "The accuracy of the timestamps."]
22811 pub timestamp_accuracy: MavOdidTimeAcc,
22812}
22813impl OPEN_DRONE_ID_LOCATION_DATA {
22814 pub const ENCODED_LEN: usize = 59usize;
22815 pub const DEFAULT: Self = Self {
22816 latitude: 0_i32,
22817 longitude: 0_i32,
22818 altitude_barometric: 0.0_f32,
22819 altitude_geodetic: 0.0_f32,
22820 height: 0.0_f32,
22821 timestamp: 0.0_f32,
22822 direction: 0_u16,
22823 speed_horizontal: 0_u16,
22824 speed_vertical: 0_i16,
22825 target_system: 0_u8,
22826 target_component: 0_u8,
22827 id_or_mac: [0_u8; 20usize],
22828 status: MavOdidStatus::DEFAULT,
22829 height_reference: MavOdidHeightRef::DEFAULT,
22830 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
22831 vertical_accuracy: MavOdidVerAcc::DEFAULT,
22832 barometer_accuracy: MavOdidVerAcc::DEFAULT,
22833 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
22834 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
22835 };
22836 #[cfg(feature = "arbitrary")]
22837 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22838 use arbitrary::{Arbitrary, Unstructured};
22839 let mut buf = [0u8; 1024];
22840 rng.fill_bytes(&mut buf);
22841 let mut unstructured = Unstructured::new(&buf);
22842 Self::arbitrary(&mut unstructured).unwrap_or_default()
22843 }
22844}
22845impl Default for OPEN_DRONE_ID_LOCATION_DATA {
22846 fn default() -> Self {
22847 Self::DEFAULT.clone()
22848 }
22849}
22850impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
22851 type Message = MavMessage;
22852 const ID: u32 = 12901u32;
22853 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
22854 const EXTRA_CRC: u8 = 254u8;
22855 const ENCODED_LEN: usize = 59usize;
22856 fn deser(
22857 _version: MavlinkVersion,
22858 __input: &[u8],
22859 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22860 let avail_len = __input.len();
22861 let mut payload_buf = [0; Self::ENCODED_LEN];
22862 let mut buf = if avail_len < Self::ENCODED_LEN {
22863 payload_buf[0..avail_len].copy_from_slice(__input);
22864 Bytes::new(&payload_buf)
22865 } else {
22866 Bytes::new(__input)
22867 };
22868 let mut __struct = Self::default();
22869 __struct.latitude = buf.get_i32_le()?;
22870 __struct.longitude = buf.get_i32_le()?;
22871 __struct.altitude_barometric = buf.get_f32_le()?;
22872 __struct.altitude_geodetic = buf.get_f32_le()?;
22873 __struct.height = buf.get_f32_le()?;
22874 __struct.timestamp = buf.get_f32_le()?;
22875 __struct.direction = buf.get_u16_le()?;
22876 __struct.speed_horizontal = buf.get_u16_le()?;
22877 __struct.speed_vertical = buf.get_i16_le()?;
22878 __struct.target_system = buf.get_u8()?;
22879 __struct.target_component = buf.get_u8()?;
22880 for v in &mut __struct.id_or_mac {
22881 let val = buf.get_u8()?;
22882 *v = val;
22883 }
22884 let tmp = buf.get_u8()?;
22885 __struct.status =
22886 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22887 enum_type: "MavOdidStatus",
22888 value: tmp as u64,
22889 })?;
22890 let tmp = buf.get_u8()?;
22891 __struct.height_reference =
22892 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22893 enum_type: "MavOdidHeightRef",
22894 value: tmp as u64,
22895 })?;
22896 let tmp = buf.get_u8()?;
22897 __struct.horizontal_accuracy =
22898 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22899 enum_type: "MavOdidHorAcc",
22900 value: tmp as u64,
22901 })?;
22902 let tmp = buf.get_u8()?;
22903 __struct.vertical_accuracy =
22904 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22905 enum_type: "MavOdidVerAcc",
22906 value: tmp as u64,
22907 })?;
22908 let tmp = buf.get_u8()?;
22909 __struct.barometer_accuracy =
22910 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22911 enum_type: "MavOdidVerAcc",
22912 value: tmp as u64,
22913 })?;
22914 let tmp = buf.get_u8()?;
22915 __struct.speed_accuracy =
22916 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22917 enum_type: "MavOdidSpeedAcc",
22918 value: tmp as u64,
22919 })?;
22920 let tmp = buf.get_u8()?;
22921 __struct.timestamp_accuracy =
22922 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22923 enum_type: "MavOdidTimeAcc",
22924 value: tmp as u64,
22925 })?;
22926 Ok(__struct)
22927 }
22928 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22929 let mut __tmp = BytesMut::new(bytes);
22930 #[allow(clippy::absurd_extreme_comparisons)]
22931 #[allow(unused_comparisons)]
22932 if __tmp.remaining() < Self::ENCODED_LEN {
22933 panic!(
22934 "buffer is too small (need {} bytes, but got {})",
22935 Self::ENCODED_LEN,
22936 __tmp.remaining(),
22937 )
22938 }
22939 __tmp.put_i32_le(self.latitude);
22940 __tmp.put_i32_le(self.longitude);
22941 __tmp.put_f32_le(self.altitude_barometric);
22942 __tmp.put_f32_le(self.altitude_geodetic);
22943 __tmp.put_f32_le(self.height);
22944 __tmp.put_f32_le(self.timestamp);
22945 __tmp.put_u16_le(self.direction);
22946 __tmp.put_u16_le(self.speed_horizontal);
22947 __tmp.put_i16_le(self.speed_vertical);
22948 __tmp.put_u8(self.target_system);
22949 __tmp.put_u8(self.target_component);
22950 for val in &self.id_or_mac {
22951 __tmp.put_u8(*val);
22952 }
22953 __tmp.put_u8(self.status as u8);
22954 __tmp.put_u8(self.height_reference as u8);
22955 __tmp.put_u8(self.horizontal_accuracy as u8);
22956 __tmp.put_u8(self.vertical_accuracy as u8);
22957 __tmp.put_u8(self.barometer_accuracy as u8);
22958 __tmp.put_u8(self.speed_accuracy as u8);
22959 __tmp.put_u8(self.timestamp_accuracy as u8);
22960 if matches!(version, MavlinkVersion::V2) {
22961 let len = __tmp.len();
22962 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22963 } else {
22964 __tmp.len()
22965 }
22966 }
22967}
22968#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
22969#[doc = ""]
22970#[doc = "ID: 12915"]
22971#[derive(Debug, Clone, PartialEq)]
22972#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22973#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22974#[cfg_attr(feature = "ts", derive(TS))]
22975#[cfg_attr(feature = "ts", ts(export))]
22976pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22977 #[doc = "System ID (0 for broadcast)."]
22978 pub target_system: u8,
22979 #[doc = "Component ID (0 for broadcast)."]
22980 pub target_component: u8,
22981 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22982 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22983 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22984 pub id_or_mac: [u8; 20],
22985 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
22986 pub single_message_size: u8,
22987 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
22988 pub msg_pack_size: u8,
22989 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
22990 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22991 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22992 pub messages: [u8; 225],
22993}
22994impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22995 pub const ENCODED_LEN: usize = 249usize;
22996 pub const DEFAULT: Self = Self {
22997 target_system: 0_u8,
22998 target_component: 0_u8,
22999 id_or_mac: [0_u8; 20usize],
23000 single_message_size: 0_u8,
23001 msg_pack_size: 0_u8,
23002 messages: [0_u8; 225usize],
23003 };
23004 #[cfg(feature = "arbitrary")]
23005 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23006 use arbitrary::{Arbitrary, Unstructured};
23007 let mut buf = [0u8; 1024];
23008 rng.fill_bytes(&mut buf);
23009 let mut unstructured = Unstructured::new(&buf);
23010 Self::arbitrary(&mut unstructured).unwrap_or_default()
23011 }
23012}
23013impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
23014 fn default() -> Self {
23015 Self::DEFAULT.clone()
23016 }
23017}
23018impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
23019 type Message = MavMessage;
23020 const ID: u32 = 12915u32;
23021 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
23022 const EXTRA_CRC: u8 = 94u8;
23023 const ENCODED_LEN: usize = 249usize;
23024 fn deser(
23025 _version: MavlinkVersion,
23026 __input: &[u8],
23027 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23028 let avail_len = __input.len();
23029 let mut payload_buf = [0; Self::ENCODED_LEN];
23030 let mut buf = if avail_len < Self::ENCODED_LEN {
23031 payload_buf[0..avail_len].copy_from_slice(__input);
23032 Bytes::new(&payload_buf)
23033 } else {
23034 Bytes::new(__input)
23035 };
23036 let mut __struct = Self::default();
23037 __struct.target_system = buf.get_u8()?;
23038 __struct.target_component = buf.get_u8()?;
23039 for v in &mut __struct.id_or_mac {
23040 let val = buf.get_u8()?;
23041 *v = val;
23042 }
23043 __struct.single_message_size = buf.get_u8()?;
23044 __struct.msg_pack_size = buf.get_u8()?;
23045 for v in &mut __struct.messages {
23046 let val = buf.get_u8()?;
23047 *v = val;
23048 }
23049 Ok(__struct)
23050 }
23051 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23052 let mut __tmp = BytesMut::new(bytes);
23053 #[allow(clippy::absurd_extreme_comparisons)]
23054 #[allow(unused_comparisons)]
23055 if __tmp.remaining() < Self::ENCODED_LEN {
23056 panic!(
23057 "buffer is too small (need {} bytes, but got {})",
23058 Self::ENCODED_LEN,
23059 __tmp.remaining(),
23060 )
23061 }
23062 __tmp.put_u8(self.target_system);
23063 __tmp.put_u8(self.target_component);
23064 for val in &self.id_or_mac {
23065 __tmp.put_u8(*val);
23066 }
23067 __tmp.put_u8(self.single_message_size);
23068 __tmp.put_u8(self.msg_pack_size);
23069 for val in &self.messages {
23070 __tmp.put_u8(*val);
23071 }
23072 if matches!(version, MavlinkVersion::V2) {
23073 let len = __tmp.len();
23074 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23075 } else {
23076 __tmp.len()
23077 }
23078 }
23079}
23080#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
23081#[doc = ""]
23082#[doc = "ID: 12905"]
23083#[derive(Debug, Clone, PartialEq)]
23084#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23085#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23086#[cfg_attr(feature = "ts", derive(TS))]
23087#[cfg_attr(feature = "ts", ts(export))]
23088pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
23089 #[doc = "System ID (0 for broadcast)."]
23090 pub target_system: u8,
23091 #[doc = "Component ID (0 for broadcast)."]
23092 pub target_component: u8,
23093 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
23094 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23095 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23096 pub id_or_mac: [u8; 20],
23097 #[doc = "Indicates the type of the operator_id field."]
23098 pub operator_id_type: MavOdidOperatorIdType,
23099 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
23100 #[cfg_attr(feature = "ts", ts(type = "string"))]
23101 pub operator_id: CharArray<20>,
23102}
23103impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
23104 pub const ENCODED_LEN: usize = 43usize;
23105 pub const DEFAULT: Self = Self {
23106 target_system: 0_u8,
23107 target_component: 0_u8,
23108 id_or_mac: [0_u8; 20usize],
23109 operator_id_type: MavOdidOperatorIdType::DEFAULT,
23110 operator_id: CharArray::new([0_u8; 20usize]),
23111 };
23112 #[cfg(feature = "arbitrary")]
23113 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23114 use arbitrary::{Arbitrary, Unstructured};
23115 let mut buf = [0u8; 1024];
23116 rng.fill_bytes(&mut buf);
23117 let mut unstructured = Unstructured::new(&buf);
23118 Self::arbitrary(&mut unstructured).unwrap_or_default()
23119 }
23120}
23121impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
23122 fn default() -> Self {
23123 Self::DEFAULT.clone()
23124 }
23125}
23126impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
23127 type Message = MavMessage;
23128 const ID: u32 = 12905u32;
23129 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
23130 const EXTRA_CRC: u8 = 49u8;
23131 const ENCODED_LEN: usize = 43usize;
23132 fn deser(
23133 _version: MavlinkVersion,
23134 __input: &[u8],
23135 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23136 let avail_len = __input.len();
23137 let mut payload_buf = [0; Self::ENCODED_LEN];
23138 let mut buf = if avail_len < Self::ENCODED_LEN {
23139 payload_buf[0..avail_len].copy_from_slice(__input);
23140 Bytes::new(&payload_buf)
23141 } else {
23142 Bytes::new(__input)
23143 };
23144 let mut __struct = Self::default();
23145 __struct.target_system = buf.get_u8()?;
23146 __struct.target_component = buf.get_u8()?;
23147 for v in &mut __struct.id_or_mac {
23148 let val = buf.get_u8()?;
23149 *v = val;
23150 }
23151 let tmp = buf.get_u8()?;
23152 __struct.operator_id_type =
23153 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23154 enum_type: "MavOdidOperatorIdType",
23155 value: tmp as u64,
23156 })?;
23157 let mut tmp = [0_u8; 20usize];
23158 for v in &mut tmp {
23159 *v = buf.get_u8()?;
23160 }
23161 __struct.operator_id = CharArray::new(tmp);
23162 Ok(__struct)
23163 }
23164 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23165 let mut __tmp = BytesMut::new(bytes);
23166 #[allow(clippy::absurd_extreme_comparisons)]
23167 #[allow(unused_comparisons)]
23168 if __tmp.remaining() < Self::ENCODED_LEN {
23169 panic!(
23170 "buffer is too small (need {} bytes, but got {})",
23171 Self::ENCODED_LEN,
23172 __tmp.remaining(),
23173 )
23174 }
23175 __tmp.put_u8(self.target_system);
23176 __tmp.put_u8(self.target_component);
23177 for val in &self.id_or_mac {
23178 __tmp.put_u8(*val);
23179 }
23180 __tmp.put_u8(self.operator_id_type as u8);
23181 for val in &self.operator_id {
23182 __tmp.put_u8(*val);
23183 }
23184 if matches!(version, MavlinkVersion::V2) {
23185 let len = __tmp.len();
23186 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23187 } else {
23188 __tmp.len()
23189 }
23190 }
23191}
23192#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
23193#[doc = ""]
23194#[doc = "ID: 12903"]
23195#[derive(Debug, Clone, PartialEq)]
23196#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23197#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23198#[cfg_attr(feature = "ts", derive(TS))]
23199#[cfg_attr(feature = "ts", ts(export))]
23200pub struct OPEN_DRONE_ID_SELF_ID_DATA {
23201 #[doc = "System ID (0 for broadcast)."]
23202 pub target_system: u8,
23203 #[doc = "Component ID (0 for broadcast)."]
23204 pub target_component: u8,
23205 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
23206 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23207 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23208 pub id_or_mac: [u8; 20],
23209 #[doc = "Indicates the type of the description field."]
23210 pub description_type: MavOdidDescType,
23211 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
23212 #[cfg_attr(feature = "ts", ts(type = "string"))]
23213 pub description: CharArray<23>,
23214}
23215impl OPEN_DRONE_ID_SELF_ID_DATA {
23216 pub const ENCODED_LEN: usize = 46usize;
23217 pub const DEFAULT: Self = Self {
23218 target_system: 0_u8,
23219 target_component: 0_u8,
23220 id_or_mac: [0_u8; 20usize],
23221 description_type: MavOdidDescType::DEFAULT,
23222 description: CharArray::new([0_u8; 23usize]),
23223 };
23224 #[cfg(feature = "arbitrary")]
23225 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23226 use arbitrary::{Arbitrary, Unstructured};
23227 let mut buf = [0u8; 1024];
23228 rng.fill_bytes(&mut buf);
23229 let mut unstructured = Unstructured::new(&buf);
23230 Self::arbitrary(&mut unstructured).unwrap_or_default()
23231 }
23232}
23233impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
23234 fn default() -> Self {
23235 Self::DEFAULT.clone()
23236 }
23237}
23238impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
23239 type Message = MavMessage;
23240 const ID: u32 = 12903u32;
23241 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
23242 const EXTRA_CRC: u8 = 249u8;
23243 const ENCODED_LEN: usize = 46usize;
23244 fn deser(
23245 _version: MavlinkVersion,
23246 __input: &[u8],
23247 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23248 let avail_len = __input.len();
23249 let mut payload_buf = [0; Self::ENCODED_LEN];
23250 let mut buf = if avail_len < Self::ENCODED_LEN {
23251 payload_buf[0..avail_len].copy_from_slice(__input);
23252 Bytes::new(&payload_buf)
23253 } else {
23254 Bytes::new(__input)
23255 };
23256 let mut __struct = Self::default();
23257 __struct.target_system = buf.get_u8()?;
23258 __struct.target_component = buf.get_u8()?;
23259 for v in &mut __struct.id_or_mac {
23260 let val = buf.get_u8()?;
23261 *v = val;
23262 }
23263 let tmp = buf.get_u8()?;
23264 __struct.description_type =
23265 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23266 enum_type: "MavOdidDescType",
23267 value: tmp as u64,
23268 })?;
23269 let mut tmp = [0_u8; 23usize];
23270 for v in &mut tmp {
23271 *v = buf.get_u8()?;
23272 }
23273 __struct.description = CharArray::new(tmp);
23274 Ok(__struct)
23275 }
23276 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23277 let mut __tmp = BytesMut::new(bytes);
23278 #[allow(clippy::absurd_extreme_comparisons)]
23279 #[allow(unused_comparisons)]
23280 if __tmp.remaining() < Self::ENCODED_LEN {
23281 panic!(
23282 "buffer is too small (need {} bytes, but got {})",
23283 Self::ENCODED_LEN,
23284 __tmp.remaining(),
23285 )
23286 }
23287 __tmp.put_u8(self.target_system);
23288 __tmp.put_u8(self.target_component);
23289 for val in &self.id_or_mac {
23290 __tmp.put_u8(*val);
23291 }
23292 __tmp.put_u8(self.description_type as u8);
23293 for val in &self.description {
23294 __tmp.put_u8(*val);
23295 }
23296 if matches!(version, MavlinkVersion::V2) {
23297 let len = __tmp.len();
23298 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23299 } else {
23300 __tmp.len()
23301 }
23302 }
23303}
23304#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
23305#[doc = ""]
23306#[doc = "ID: 12904"]
23307#[derive(Debug, Clone, PartialEq)]
23308#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23309#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23310#[cfg_attr(feature = "ts", derive(TS))]
23311#[cfg_attr(feature = "ts", ts(export))]
23312pub struct OPEN_DRONE_ID_SYSTEM_DATA {
23313 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
23314 pub operator_latitude: i32,
23315 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
23316 pub operator_longitude: i32,
23317 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
23318 pub area_ceiling: f32,
23319 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
23320 pub area_floor: f32,
23321 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
23322 pub operator_altitude_geo: f32,
23323 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
23324 pub timestamp: u32,
23325 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
23326 pub area_count: u16,
23327 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
23328 pub area_radius: u16,
23329 #[doc = "System ID (0 for broadcast)."]
23330 pub target_system: u8,
23331 #[doc = "Component ID (0 for broadcast)."]
23332 pub target_component: u8,
23333 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
23334 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23335 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23336 pub id_or_mac: [u8; 20],
23337 #[doc = "Specifies the operator location type."]
23338 pub operator_location_type: MavOdidOperatorLocationType,
23339 #[doc = "Specifies the classification type of the UA."]
23340 pub classification_type: MavOdidClassificationType,
23341 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
23342 pub category_eu: MavOdidCategoryEu,
23343 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
23344 pub class_eu: MavOdidClassEu,
23345}
23346impl OPEN_DRONE_ID_SYSTEM_DATA {
23347 pub const ENCODED_LEN: usize = 54usize;
23348 pub const DEFAULT: Self = Self {
23349 operator_latitude: 0_i32,
23350 operator_longitude: 0_i32,
23351 area_ceiling: 0.0_f32,
23352 area_floor: 0.0_f32,
23353 operator_altitude_geo: 0.0_f32,
23354 timestamp: 0_u32,
23355 area_count: 0_u16,
23356 area_radius: 0_u16,
23357 target_system: 0_u8,
23358 target_component: 0_u8,
23359 id_or_mac: [0_u8; 20usize],
23360 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
23361 classification_type: MavOdidClassificationType::DEFAULT,
23362 category_eu: MavOdidCategoryEu::DEFAULT,
23363 class_eu: MavOdidClassEu::DEFAULT,
23364 };
23365 #[cfg(feature = "arbitrary")]
23366 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23367 use arbitrary::{Arbitrary, Unstructured};
23368 let mut buf = [0u8; 1024];
23369 rng.fill_bytes(&mut buf);
23370 let mut unstructured = Unstructured::new(&buf);
23371 Self::arbitrary(&mut unstructured).unwrap_or_default()
23372 }
23373}
23374impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
23375 fn default() -> Self {
23376 Self::DEFAULT.clone()
23377 }
23378}
23379impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
23380 type Message = MavMessage;
23381 const ID: u32 = 12904u32;
23382 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
23383 const EXTRA_CRC: u8 = 77u8;
23384 const ENCODED_LEN: usize = 54usize;
23385 fn deser(
23386 _version: MavlinkVersion,
23387 __input: &[u8],
23388 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23389 let avail_len = __input.len();
23390 let mut payload_buf = [0; Self::ENCODED_LEN];
23391 let mut buf = if avail_len < Self::ENCODED_LEN {
23392 payload_buf[0..avail_len].copy_from_slice(__input);
23393 Bytes::new(&payload_buf)
23394 } else {
23395 Bytes::new(__input)
23396 };
23397 let mut __struct = Self::default();
23398 __struct.operator_latitude = buf.get_i32_le()?;
23399 __struct.operator_longitude = buf.get_i32_le()?;
23400 __struct.area_ceiling = buf.get_f32_le()?;
23401 __struct.area_floor = buf.get_f32_le()?;
23402 __struct.operator_altitude_geo = buf.get_f32_le()?;
23403 __struct.timestamp = buf.get_u32_le()?;
23404 __struct.area_count = buf.get_u16_le()?;
23405 __struct.area_radius = buf.get_u16_le()?;
23406 __struct.target_system = buf.get_u8()?;
23407 __struct.target_component = buf.get_u8()?;
23408 for v in &mut __struct.id_or_mac {
23409 let val = buf.get_u8()?;
23410 *v = val;
23411 }
23412 let tmp = buf.get_u8()?;
23413 __struct.operator_location_type =
23414 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23415 enum_type: "MavOdidOperatorLocationType",
23416 value: tmp as u64,
23417 })?;
23418 let tmp = buf.get_u8()?;
23419 __struct.classification_type =
23420 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23421 enum_type: "MavOdidClassificationType",
23422 value: tmp as u64,
23423 })?;
23424 let tmp = buf.get_u8()?;
23425 __struct.category_eu =
23426 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23427 enum_type: "MavOdidCategoryEu",
23428 value: tmp as u64,
23429 })?;
23430 let tmp = buf.get_u8()?;
23431 __struct.class_eu =
23432 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23433 enum_type: "MavOdidClassEu",
23434 value: tmp as u64,
23435 })?;
23436 Ok(__struct)
23437 }
23438 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23439 let mut __tmp = BytesMut::new(bytes);
23440 #[allow(clippy::absurd_extreme_comparisons)]
23441 #[allow(unused_comparisons)]
23442 if __tmp.remaining() < Self::ENCODED_LEN {
23443 panic!(
23444 "buffer is too small (need {} bytes, but got {})",
23445 Self::ENCODED_LEN,
23446 __tmp.remaining(),
23447 )
23448 }
23449 __tmp.put_i32_le(self.operator_latitude);
23450 __tmp.put_i32_le(self.operator_longitude);
23451 __tmp.put_f32_le(self.area_ceiling);
23452 __tmp.put_f32_le(self.area_floor);
23453 __tmp.put_f32_le(self.operator_altitude_geo);
23454 __tmp.put_u32_le(self.timestamp);
23455 __tmp.put_u16_le(self.area_count);
23456 __tmp.put_u16_le(self.area_radius);
23457 __tmp.put_u8(self.target_system);
23458 __tmp.put_u8(self.target_component);
23459 for val in &self.id_or_mac {
23460 __tmp.put_u8(*val);
23461 }
23462 __tmp.put_u8(self.operator_location_type as u8);
23463 __tmp.put_u8(self.classification_type as u8);
23464 __tmp.put_u8(self.category_eu as u8);
23465 __tmp.put_u8(self.class_eu as u8);
23466 if matches!(version, MavlinkVersion::V2) {
23467 let len = __tmp.len();
23468 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23469 } else {
23470 __tmp.len()
23471 }
23472 }
23473}
23474#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
23475#[doc = ""]
23476#[doc = "ID: 12919"]
23477#[derive(Debug, Clone, PartialEq)]
23478#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23479#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23480#[cfg_attr(feature = "ts", derive(TS))]
23481#[cfg_attr(feature = "ts", ts(export))]
23482pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23483 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
23484 pub operator_latitude: i32,
23485 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
23486 pub operator_longitude: i32,
23487 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
23488 pub operator_altitude_geo: f32,
23489 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
23490 pub timestamp: u32,
23491 #[doc = "System ID (0 for broadcast)."]
23492 pub target_system: u8,
23493 #[doc = "Component ID (0 for broadcast)."]
23494 pub target_component: u8,
23495}
23496impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23497 pub const ENCODED_LEN: usize = 18usize;
23498 pub const DEFAULT: Self = Self {
23499 operator_latitude: 0_i32,
23500 operator_longitude: 0_i32,
23501 operator_altitude_geo: 0.0_f32,
23502 timestamp: 0_u32,
23503 target_system: 0_u8,
23504 target_component: 0_u8,
23505 };
23506 #[cfg(feature = "arbitrary")]
23507 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23508 use arbitrary::{Arbitrary, Unstructured};
23509 let mut buf = [0u8; 1024];
23510 rng.fill_bytes(&mut buf);
23511 let mut unstructured = Unstructured::new(&buf);
23512 Self::arbitrary(&mut unstructured).unwrap_or_default()
23513 }
23514}
23515impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23516 fn default() -> Self {
23517 Self::DEFAULT.clone()
23518 }
23519}
23520impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23521 type Message = MavMessage;
23522 const ID: u32 = 12919u32;
23523 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
23524 const EXTRA_CRC: u8 = 7u8;
23525 const ENCODED_LEN: usize = 18usize;
23526 fn deser(
23527 _version: MavlinkVersion,
23528 __input: &[u8],
23529 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23530 let avail_len = __input.len();
23531 let mut payload_buf = [0; Self::ENCODED_LEN];
23532 let mut buf = if avail_len < Self::ENCODED_LEN {
23533 payload_buf[0..avail_len].copy_from_slice(__input);
23534 Bytes::new(&payload_buf)
23535 } else {
23536 Bytes::new(__input)
23537 };
23538 let mut __struct = Self::default();
23539 __struct.operator_latitude = buf.get_i32_le()?;
23540 __struct.operator_longitude = buf.get_i32_le()?;
23541 __struct.operator_altitude_geo = buf.get_f32_le()?;
23542 __struct.timestamp = buf.get_u32_le()?;
23543 __struct.target_system = buf.get_u8()?;
23544 __struct.target_component = buf.get_u8()?;
23545 Ok(__struct)
23546 }
23547 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23548 let mut __tmp = BytesMut::new(bytes);
23549 #[allow(clippy::absurd_extreme_comparisons)]
23550 #[allow(unused_comparisons)]
23551 if __tmp.remaining() < Self::ENCODED_LEN {
23552 panic!(
23553 "buffer is too small (need {} bytes, but got {})",
23554 Self::ENCODED_LEN,
23555 __tmp.remaining(),
23556 )
23557 }
23558 __tmp.put_i32_le(self.operator_latitude);
23559 __tmp.put_i32_le(self.operator_longitude);
23560 __tmp.put_f32_le(self.operator_altitude_geo);
23561 __tmp.put_u32_le(self.timestamp);
23562 __tmp.put_u8(self.target_system);
23563 __tmp.put_u8(self.target_component);
23564 if matches!(version, MavlinkVersion::V2) {
23565 let len = __tmp.len();
23566 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23567 } else {
23568 __tmp.len()
23569 }
23570 }
23571}
23572#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
23573#[doc = ""]
23574#[doc = "ID: 100"]
23575#[derive(Debug, Clone, PartialEq)]
23576#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23577#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23578#[cfg_attr(feature = "ts", derive(TS))]
23579#[cfg_attr(feature = "ts", ts(export))]
23580pub struct OPTICAL_FLOW_DATA {
23581 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23582 pub time_usec: u64,
23583 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
23584 pub flow_comp_m_x: f32,
23585 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
23586 pub flow_comp_m_y: f32,
23587 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
23588 pub ground_distance: f32,
23589 #[doc = "Flow in x-sensor direction"]
23590 pub flow_x: i16,
23591 #[doc = "Flow in y-sensor direction"]
23592 pub flow_y: i16,
23593 #[doc = "Sensor ID"]
23594 pub sensor_id: u8,
23595 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
23596 pub quality: u8,
23597 #[doc = "Flow rate about X axis"]
23598 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23599 pub flow_rate_x: f32,
23600 #[doc = "Flow rate about Y axis"]
23601 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23602 pub flow_rate_y: f32,
23603}
23604impl OPTICAL_FLOW_DATA {
23605 pub const ENCODED_LEN: usize = 34usize;
23606 pub const DEFAULT: Self = Self {
23607 time_usec: 0_u64,
23608 flow_comp_m_x: 0.0_f32,
23609 flow_comp_m_y: 0.0_f32,
23610 ground_distance: 0.0_f32,
23611 flow_x: 0_i16,
23612 flow_y: 0_i16,
23613 sensor_id: 0_u8,
23614 quality: 0_u8,
23615 flow_rate_x: 0.0_f32,
23616 flow_rate_y: 0.0_f32,
23617 };
23618 #[cfg(feature = "arbitrary")]
23619 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23620 use arbitrary::{Arbitrary, Unstructured};
23621 let mut buf = [0u8; 1024];
23622 rng.fill_bytes(&mut buf);
23623 let mut unstructured = Unstructured::new(&buf);
23624 Self::arbitrary(&mut unstructured).unwrap_or_default()
23625 }
23626}
23627impl Default for OPTICAL_FLOW_DATA {
23628 fn default() -> Self {
23629 Self::DEFAULT.clone()
23630 }
23631}
23632impl MessageData for OPTICAL_FLOW_DATA {
23633 type Message = MavMessage;
23634 const ID: u32 = 100u32;
23635 const NAME: &'static str = "OPTICAL_FLOW";
23636 const EXTRA_CRC: u8 = 175u8;
23637 const ENCODED_LEN: usize = 34usize;
23638 fn deser(
23639 _version: MavlinkVersion,
23640 __input: &[u8],
23641 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23642 let avail_len = __input.len();
23643 let mut payload_buf = [0; Self::ENCODED_LEN];
23644 let mut buf = if avail_len < Self::ENCODED_LEN {
23645 payload_buf[0..avail_len].copy_from_slice(__input);
23646 Bytes::new(&payload_buf)
23647 } else {
23648 Bytes::new(__input)
23649 };
23650 let mut __struct = Self::default();
23651 __struct.time_usec = buf.get_u64_le()?;
23652 __struct.flow_comp_m_x = buf.get_f32_le()?;
23653 __struct.flow_comp_m_y = buf.get_f32_le()?;
23654 __struct.ground_distance = buf.get_f32_le()?;
23655 __struct.flow_x = buf.get_i16_le()?;
23656 __struct.flow_y = buf.get_i16_le()?;
23657 __struct.sensor_id = buf.get_u8()?;
23658 __struct.quality = buf.get_u8()?;
23659 __struct.flow_rate_x = buf.get_f32_le()?;
23660 __struct.flow_rate_y = buf.get_f32_le()?;
23661 Ok(__struct)
23662 }
23663 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23664 let mut __tmp = BytesMut::new(bytes);
23665 #[allow(clippy::absurd_extreme_comparisons)]
23666 #[allow(unused_comparisons)]
23667 if __tmp.remaining() < Self::ENCODED_LEN {
23668 panic!(
23669 "buffer is too small (need {} bytes, but got {})",
23670 Self::ENCODED_LEN,
23671 __tmp.remaining(),
23672 )
23673 }
23674 __tmp.put_u64_le(self.time_usec);
23675 __tmp.put_f32_le(self.flow_comp_m_x);
23676 __tmp.put_f32_le(self.flow_comp_m_y);
23677 __tmp.put_f32_le(self.ground_distance);
23678 __tmp.put_i16_le(self.flow_x);
23679 __tmp.put_i16_le(self.flow_y);
23680 __tmp.put_u8(self.sensor_id);
23681 __tmp.put_u8(self.quality);
23682 if matches!(version, MavlinkVersion::V2) {
23683 __tmp.put_f32_le(self.flow_rate_x);
23684 __tmp.put_f32_le(self.flow_rate_y);
23685 let len = __tmp.len();
23686 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23687 } else {
23688 __tmp.len()
23689 }
23690 }
23691}
23692#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
23693#[doc = ""]
23694#[doc = "ID: 106"]
23695#[derive(Debug, Clone, PartialEq)]
23696#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23697#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23698#[cfg_attr(feature = "ts", derive(TS))]
23699#[cfg_attr(feature = "ts", ts(export))]
23700pub struct OPTICAL_FLOW_RAD_DATA {
23701 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23702 pub time_usec: u64,
23703 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
23704 pub integration_time_us: u32,
23705 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
23706 pub integrated_x: f32,
23707 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
23708 pub integrated_y: f32,
23709 #[doc = "RH rotation around X axis"]
23710 pub integrated_xgyro: f32,
23711 #[doc = "RH rotation around Y axis"]
23712 pub integrated_ygyro: f32,
23713 #[doc = "RH rotation around Z axis"]
23714 pub integrated_zgyro: f32,
23715 #[doc = "Time since the distance was sampled."]
23716 pub time_delta_distance_us: u32,
23717 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
23718 pub distance: f32,
23719 #[doc = "Temperature"]
23720 pub temperature: i16,
23721 #[doc = "Sensor ID"]
23722 pub sensor_id: u8,
23723 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
23724 pub quality: u8,
23725}
23726impl OPTICAL_FLOW_RAD_DATA {
23727 pub const ENCODED_LEN: usize = 44usize;
23728 pub const DEFAULT: Self = Self {
23729 time_usec: 0_u64,
23730 integration_time_us: 0_u32,
23731 integrated_x: 0.0_f32,
23732 integrated_y: 0.0_f32,
23733 integrated_xgyro: 0.0_f32,
23734 integrated_ygyro: 0.0_f32,
23735 integrated_zgyro: 0.0_f32,
23736 time_delta_distance_us: 0_u32,
23737 distance: 0.0_f32,
23738 temperature: 0_i16,
23739 sensor_id: 0_u8,
23740 quality: 0_u8,
23741 };
23742 #[cfg(feature = "arbitrary")]
23743 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23744 use arbitrary::{Arbitrary, Unstructured};
23745 let mut buf = [0u8; 1024];
23746 rng.fill_bytes(&mut buf);
23747 let mut unstructured = Unstructured::new(&buf);
23748 Self::arbitrary(&mut unstructured).unwrap_or_default()
23749 }
23750}
23751impl Default for OPTICAL_FLOW_RAD_DATA {
23752 fn default() -> Self {
23753 Self::DEFAULT.clone()
23754 }
23755}
23756impl MessageData for OPTICAL_FLOW_RAD_DATA {
23757 type Message = MavMessage;
23758 const ID: u32 = 106u32;
23759 const NAME: &'static str = "OPTICAL_FLOW_RAD";
23760 const EXTRA_CRC: u8 = 138u8;
23761 const ENCODED_LEN: usize = 44usize;
23762 fn deser(
23763 _version: MavlinkVersion,
23764 __input: &[u8],
23765 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23766 let avail_len = __input.len();
23767 let mut payload_buf = [0; Self::ENCODED_LEN];
23768 let mut buf = if avail_len < Self::ENCODED_LEN {
23769 payload_buf[0..avail_len].copy_from_slice(__input);
23770 Bytes::new(&payload_buf)
23771 } else {
23772 Bytes::new(__input)
23773 };
23774 let mut __struct = Self::default();
23775 __struct.time_usec = buf.get_u64_le()?;
23776 __struct.integration_time_us = buf.get_u32_le()?;
23777 __struct.integrated_x = buf.get_f32_le()?;
23778 __struct.integrated_y = buf.get_f32_le()?;
23779 __struct.integrated_xgyro = buf.get_f32_le()?;
23780 __struct.integrated_ygyro = buf.get_f32_le()?;
23781 __struct.integrated_zgyro = buf.get_f32_le()?;
23782 __struct.time_delta_distance_us = buf.get_u32_le()?;
23783 __struct.distance = buf.get_f32_le()?;
23784 __struct.temperature = buf.get_i16_le()?;
23785 __struct.sensor_id = buf.get_u8()?;
23786 __struct.quality = buf.get_u8()?;
23787 Ok(__struct)
23788 }
23789 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23790 let mut __tmp = BytesMut::new(bytes);
23791 #[allow(clippy::absurd_extreme_comparisons)]
23792 #[allow(unused_comparisons)]
23793 if __tmp.remaining() < Self::ENCODED_LEN {
23794 panic!(
23795 "buffer is too small (need {} bytes, but got {})",
23796 Self::ENCODED_LEN,
23797 __tmp.remaining(),
23798 )
23799 }
23800 __tmp.put_u64_le(self.time_usec);
23801 __tmp.put_u32_le(self.integration_time_us);
23802 __tmp.put_f32_le(self.integrated_x);
23803 __tmp.put_f32_le(self.integrated_y);
23804 __tmp.put_f32_le(self.integrated_xgyro);
23805 __tmp.put_f32_le(self.integrated_ygyro);
23806 __tmp.put_f32_le(self.integrated_zgyro);
23807 __tmp.put_u32_le(self.time_delta_distance_us);
23808 __tmp.put_f32_le(self.distance);
23809 __tmp.put_i16_le(self.temperature);
23810 __tmp.put_u8(self.sensor_id);
23811 __tmp.put_u8(self.quality);
23812 if matches!(version, MavlinkVersion::V2) {
23813 let len = __tmp.len();
23814 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23815 } else {
23816 __tmp.len()
23817 }
23818 }
23819}
23820#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
23821#[doc = ""]
23822#[doc = "ID: 360"]
23823#[derive(Debug, Clone, PartialEq)]
23824#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23825#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23826#[cfg_attr(feature = "ts", derive(TS))]
23827#[cfg_attr(feature = "ts", ts(export))]
23828pub struct ORBIT_EXECUTION_STATUS_DATA {
23829 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23830 pub time_usec: u64,
23831 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
23832 pub radius: f32,
23833 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23834 pub x: i32,
23835 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23836 pub y: i32,
23837 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
23838 pub z: f32,
23839 #[doc = "The coordinate system of the fields: x, y, z."]
23840 pub frame: MavFrame,
23841}
23842impl ORBIT_EXECUTION_STATUS_DATA {
23843 pub const ENCODED_LEN: usize = 25usize;
23844 pub const DEFAULT: Self = Self {
23845 time_usec: 0_u64,
23846 radius: 0.0_f32,
23847 x: 0_i32,
23848 y: 0_i32,
23849 z: 0.0_f32,
23850 frame: MavFrame::DEFAULT,
23851 };
23852 #[cfg(feature = "arbitrary")]
23853 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23854 use arbitrary::{Arbitrary, Unstructured};
23855 let mut buf = [0u8; 1024];
23856 rng.fill_bytes(&mut buf);
23857 let mut unstructured = Unstructured::new(&buf);
23858 Self::arbitrary(&mut unstructured).unwrap_or_default()
23859 }
23860}
23861impl Default for ORBIT_EXECUTION_STATUS_DATA {
23862 fn default() -> Self {
23863 Self::DEFAULT.clone()
23864 }
23865}
23866impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
23867 type Message = MavMessage;
23868 const ID: u32 = 360u32;
23869 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
23870 const EXTRA_CRC: u8 = 11u8;
23871 const ENCODED_LEN: usize = 25usize;
23872 fn deser(
23873 _version: MavlinkVersion,
23874 __input: &[u8],
23875 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23876 let avail_len = __input.len();
23877 let mut payload_buf = [0; Self::ENCODED_LEN];
23878 let mut buf = if avail_len < Self::ENCODED_LEN {
23879 payload_buf[0..avail_len].copy_from_slice(__input);
23880 Bytes::new(&payload_buf)
23881 } else {
23882 Bytes::new(__input)
23883 };
23884 let mut __struct = Self::default();
23885 __struct.time_usec = buf.get_u64_le()?;
23886 __struct.radius = buf.get_f32_le()?;
23887 __struct.x = buf.get_i32_le()?;
23888 __struct.y = buf.get_i32_le()?;
23889 __struct.z = buf.get_f32_le()?;
23890 let tmp = buf.get_u8()?;
23891 __struct.frame =
23892 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23893 enum_type: "MavFrame",
23894 value: tmp as u64,
23895 })?;
23896 Ok(__struct)
23897 }
23898 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23899 let mut __tmp = BytesMut::new(bytes);
23900 #[allow(clippy::absurd_extreme_comparisons)]
23901 #[allow(unused_comparisons)]
23902 if __tmp.remaining() < Self::ENCODED_LEN {
23903 panic!(
23904 "buffer is too small (need {} bytes, but got {})",
23905 Self::ENCODED_LEN,
23906 __tmp.remaining(),
23907 )
23908 }
23909 __tmp.put_u64_le(self.time_usec);
23910 __tmp.put_f32_le(self.radius);
23911 __tmp.put_i32_le(self.x);
23912 __tmp.put_i32_le(self.y);
23913 __tmp.put_f32_le(self.z);
23914 __tmp.put_u8(self.frame as u8);
23915 if matches!(version, MavlinkVersion::V2) {
23916 let len = __tmp.len();
23917 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23918 } else {
23919 __tmp.len()
23920 }
23921 }
23922}
23923#[doc = "Response from a PARAM_EXT_SET message."]
23924#[doc = ""]
23925#[doc = "ID: 324"]
23926#[derive(Debug, Clone, PartialEq)]
23927#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23928#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23929#[cfg_attr(feature = "ts", derive(TS))]
23930#[cfg_attr(feature = "ts", ts(export))]
23931pub struct PARAM_EXT_ACK_DATA {
23932 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23933 #[cfg_attr(feature = "ts", ts(type = "string"))]
23934 pub param_id: CharArray<16>,
23935 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
23936 #[cfg_attr(feature = "ts", ts(type = "string"))]
23937 pub param_value: CharArray<128>,
23938 #[doc = "Parameter type."]
23939 pub param_type: MavParamExtType,
23940 #[doc = "Result code."]
23941 pub param_result: ParamAck,
23942}
23943impl PARAM_EXT_ACK_DATA {
23944 pub const ENCODED_LEN: usize = 146usize;
23945 pub const DEFAULT: Self = Self {
23946 param_id: CharArray::new([0_u8; 16usize]),
23947 param_value: CharArray::new([0_u8; 128usize]),
23948 param_type: MavParamExtType::DEFAULT,
23949 param_result: ParamAck::DEFAULT,
23950 };
23951 #[cfg(feature = "arbitrary")]
23952 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23953 use arbitrary::{Arbitrary, Unstructured};
23954 let mut buf = [0u8; 1024];
23955 rng.fill_bytes(&mut buf);
23956 let mut unstructured = Unstructured::new(&buf);
23957 Self::arbitrary(&mut unstructured).unwrap_or_default()
23958 }
23959}
23960impl Default for PARAM_EXT_ACK_DATA {
23961 fn default() -> Self {
23962 Self::DEFAULT.clone()
23963 }
23964}
23965impl MessageData for PARAM_EXT_ACK_DATA {
23966 type Message = MavMessage;
23967 const ID: u32 = 324u32;
23968 const NAME: &'static str = "PARAM_EXT_ACK";
23969 const EXTRA_CRC: u8 = 132u8;
23970 const ENCODED_LEN: usize = 146usize;
23971 fn deser(
23972 _version: MavlinkVersion,
23973 __input: &[u8],
23974 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23975 let avail_len = __input.len();
23976 let mut payload_buf = [0; Self::ENCODED_LEN];
23977 let mut buf = if avail_len < Self::ENCODED_LEN {
23978 payload_buf[0..avail_len].copy_from_slice(__input);
23979 Bytes::new(&payload_buf)
23980 } else {
23981 Bytes::new(__input)
23982 };
23983 let mut __struct = Self::default();
23984 let mut tmp = [0_u8; 16usize];
23985 for v in &mut tmp {
23986 *v = buf.get_u8()?;
23987 }
23988 __struct.param_id = CharArray::new(tmp);
23989 let mut tmp = [0_u8; 128usize];
23990 for v in &mut tmp {
23991 *v = buf.get_u8()?;
23992 }
23993 __struct.param_value = CharArray::new(tmp);
23994 let tmp = buf.get_u8()?;
23995 __struct.param_type =
23996 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23997 enum_type: "MavParamExtType",
23998 value: tmp as u64,
23999 })?;
24000 let tmp = buf.get_u8()?;
24001 __struct.param_result =
24002 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24003 enum_type: "ParamAck",
24004 value: tmp as u64,
24005 })?;
24006 Ok(__struct)
24007 }
24008 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24009 let mut __tmp = BytesMut::new(bytes);
24010 #[allow(clippy::absurd_extreme_comparisons)]
24011 #[allow(unused_comparisons)]
24012 if __tmp.remaining() < Self::ENCODED_LEN {
24013 panic!(
24014 "buffer is too small (need {} bytes, but got {})",
24015 Self::ENCODED_LEN,
24016 __tmp.remaining(),
24017 )
24018 }
24019 for val in &self.param_id {
24020 __tmp.put_u8(*val);
24021 }
24022 for val in &self.param_value {
24023 __tmp.put_u8(*val);
24024 }
24025 __tmp.put_u8(self.param_type as u8);
24026 __tmp.put_u8(self.param_result as u8);
24027 if matches!(version, MavlinkVersion::V2) {
24028 let len = __tmp.len();
24029 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24030 } else {
24031 __tmp.len()
24032 }
24033 }
24034}
24035#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
24036#[doc = ""]
24037#[doc = "ID: 321"]
24038#[derive(Debug, Clone, PartialEq)]
24039#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24040#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24041#[cfg_attr(feature = "ts", derive(TS))]
24042#[cfg_attr(feature = "ts", ts(export))]
24043pub struct PARAM_EXT_REQUEST_LIST_DATA {
24044 #[doc = "System ID"]
24045 pub target_system: u8,
24046 #[doc = "Component ID"]
24047 pub target_component: u8,
24048}
24049impl PARAM_EXT_REQUEST_LIST_DATA {
24050 pub const ENCODED_LEN: usize = 2usize;
24051 pub const DEFAULT: Self = Self {
24052 target_system: 0_u8,
24053 target_component: 0_u8,
24054 };
24055 #[cfg(feature = "arbitrary")]
24056 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24057 use arbitrary::{Arbitrary, Unstructured};
24058 let mut buf = [0u8; 1024];
24059 rng.fill_bytes(&mut buf);
24060 let mut unstructured = Unstructured::new(&buf);
24061 Self::arbitrary(&mut unstructured).unwrap_or_default()
24062 }
24063}
24064impl Default for PARAM_EXT_REQUEST_LIST_DATA {
24065 fn default() -> Self {
24066 Self::DEFAULT.clone()
24067 }
24068}
24069impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
24070 type Message = MavMessage;
24071 const ID: u32 = 321u32;
24072 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
24073 const EXTRA_CRC: u8 = 88u8;
24074 const ENCODED_LEN: usize = 2usize;
24075 fn deser(
24076 _version: MavlinkVersion,
24077 __input: &[u8],
24078 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24079 let avail_len = __input.len();
24080 let mut payload_buf = [0; Self::ENCODED_LEN];
24081 let mut buf = if avail_len < Self::ENCODED_LEN {
24082 payload_buf[0..avail_len].copy_from_slice(__input);
24083 Bytes::new(&payload_buf)
24084 } else {
24085 Bytes::new(__input)
24086 };
24087 let mut __struct = Self::default();
24088 __struct.target_system = buf.get_u8()?;
24089 __struct.target_component = buf.get_u8()?;
24090 Ok(__struct)
24091 }
24092 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24093 let mut __tmp = BytesMut::new(bytes);
24094 #[allow(clippy::absurd_extreme_comparisons)]
24095 #[allow(unused_comparisons)]
24096 if __tmp.remaining() < Self::ENCODED_LEN {
24097 panic!(
24098 "buffer is too small (need {} bytes, but got {})",
24099 Self::ENCODED_LEN,
24100 __tmp.remaining(),
24101 )
24102 }
24103 __tmp.put_u8(self.target_system);
24104 __tmp.put_u8(self.target_component);
24105 if matches!(version, MavlinkVersion::V2) {
24106 let len = __tmp.len();
24107 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24108 } else {
24109 __tmp.len()
24110 }
24111 }
24112}
24113#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
24114#[doc = ""]
24115#[doc = "ID: 320"]
24116#[derive(Debug, Clone, PartialEq)]
24117#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24118#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24119#[cfg_attr(feature = "ts", derive(TS))]
24120#[cfg_attr(feature = "ts", ts(export))]
24121pub struct PARAM_EXT_REQUEST_READ_DATA {
24122 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
24123 pub param_index: i16,
24124 #[doc = "System ID"]
24125 pub target_system: u8,
24126 #[doc = "Component ID"]
24127 pub target_component: u8,
24128 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24129 #[cfg_attr(feature = "ts", ts(type = "string"))]
24130 pub param_id: CharArray<16>,
24131}
24132impl PARAM_EXT_REQUEST_READ_DATA {
24133 pub const ENCODED_LEN: usize = 20usize;
24134 pub const DEFAULT: Self = Self {
24135 param_index: 0_i16,
24136 target_system: 0_u8,
24137 target_component: 0_u8,
24138 param_id: CharArray::new([0_u8; 16usize]),
24139 };
24140 #[cfg(feature = "arbitrary")]
24141 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24142 use arbitrary::{Arbitrary, Unstructured};
24143 let mut buf = [0u8; 1024];
24144 rng.fill_bytes(&mut buf);
24145 let mut unstructured = Unstructured::new(&buf);
24146 Self::arbitrary(&mut unstructured).unwrap_or_default()
24147 }
24148}
24149impl Default for PARAM_EXT_REQUEST_READ_DATA {
24150 fn default() -> Self {
24151 Self::DEFAULT.clone()
24152 }
24153}
24154impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
24155 type Message = MavMessage;
24156 const ID: u32 = 320u32;
24157 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
24158 const EXTRA_CRC: u8 = 243u8;
24159 const ENCODED_LEN: usize = 20usize;
24160 fn deser(
24161 _version: MavlinkVersion,
24162 __input: &[u8],
24163 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24164 let avail_len = __input.len();
24165 let mut payload_buf = [0; Self::ENCODED_LEN];
24166 let mut buf = if avail_len < Self::ENCODED_LEN {
24167 payload_buf[0..avail_len].copy_from_slice(__input);
24168 Bytes::new(&payload_buf)
24169 } else {
24170 Bytes::new(__input)
24171 };
24172 let mut __struct = Self::default();
24173 __struct.param_index = buf.get_i16_le()?;
24174 __struct.target_system = buf.get_u8()?;
24175 __struct.target_component = buf.get_u8()?;
24176 let mut tmp = [0_u8; 16usize];
24177 for v in &mut tmp {
24178 *v = buf.get_u8()?;
24179 }
24180 __struct.param_id = CharArray::new(tmp);
24181 Ok(__struct)
24182 }
24183 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24184 let mut __tmp = BytesMut::new(bytes);
24185 #[allow(clippy::absurd_extreme_comparisons)]
24186 #[allow(unused_comparisons)]
24187 if __tmp.remaining() < Self::ENCODED_LEN {
24188 panic!(
24189 "buffer is too small (need {} bytes, but got {})",
24190 Self::ENCODED_LEN,
24191 __tmp.remaining(),
24192 )
24193 }
24194 __tmp.put_i16_le(self.param_index);
24195 __tmp.put_u8(self.target_system);
24196 __tmp.put_u8(self.target_component);
24197 for val in &self.param_id {
24198 __tmp.put_u8(*val);
24199 }
24200 if matches!(version, MavlinkVersion::V2) {
24201 let len = __tmp.len();
24202 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24203 } else {
24204 __tmp.len()
24205 }
24206 }
24207}
24208#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
24209#[doc = ""]
24210#[doc = "ID: 323"]
24211#[derive(Debug, Clone, PartialEq)]
24212#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24213#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24214#[cfg_attr(feature = "ts", derive(TS))]
24215#[cfg_attr(feature = "ts", ts(export))]
24216pub struct PARAM_EXT_SET_DATA {
24217 #[doc = "System ID"]
24218 pub target_system: u8,
24219 #[doc = "Component ID"]
24220 pub target_component: u8,
24221 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24222 #[cfg_attr(feature = "ts", ts(type = "string"))]
24223 pub param_id: CharArray<16>,
24224 #[doc = "Parameter value"]
24225 #[cfg_attr(feature = "ts", ts(type = "string"))]
24226 pub param_value: CharArray<128>,
24227 #[doc = "Parameter type."]
24228 pub param_type: MavParamExtType,
24229}
24230impl PARAM_EXT_SET_DATA {
24231 pub const ENCODED_LEN: usize = 147usize;
24232 pub const DEFAULT: Self = Self {
24233 target_system: 0_u8,
24234 target_component: 0_u8,
24235 param_id: CharArray::new([0_u8; 16usize]),
24236 param_value: CharArray::new([0_u8; 128usize]),
24237 param_type: MavParamExtType::DEFAULT,
24238 };
24239 #[cfg(feature = "arbitrary")]
24240 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24241 use arbitrary::{Arbitrary, Unstructured};
24242 let mut buf = [0u8; 1024];
24243 rng.fill_bytes(&mut buf);
24244 let mut unstructured = Unstructured::new(&buf);
24245 Self::arbitrary(&mut unstructured).unwrap_or_default()
24246 }
24247}
24248impl Default for PARAM_EXT_SET_DATA {
24249 fn default() -> Self {
24250 Self::DEFAULT.clone()
24251 }
24252}
24253impl MessageData for PARAM_EXT_SET_DATA {
24254 type Message = MavMessage;
24255 const ID: u32 = 323u32;
24256 const NAME: &'static str = "PARAM_EXT_SET";
24257 const EXTRA_CRC: u8 = 78u8;
24258 const ENCODED_LEN: usize = 147usize;
24259 fn deser(
24260 _version: MavlinkVersion,
24261 __input: &[u8],
24262 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24263 let avail_len = __input.len();
24264 let mut payload_buf = [0; Self::ENCODED_LEN];
24265 let mut buf = if avail_len < Self::ENCODED_LEN {
24266 payload_buf[0..avail_len].copy_from_slice(__input);
24267 Bytes::new(&payload_buf)
24268 } else {
24269 Bytes::new(__input)
24270 };
24271 let mut __struct = Self::default();
24272 __struct.target_system = buf.get_u8()?;
24273 __struct.target_component = buf.get_u8()?;
24274 let mut tmp = [0_u8; 16usize];
24275 for v in &mut tmp {
24276 *v = buf.get_u8()?;
24277 }
24278 __struct.param_id = CharArray::new(tmp);
24279 let mut tmp = [0_u8; 128usize];
24280 for v in &mut tmp {
24281 *v = buf.get_u8()?;
24282 }
24283 __struct.param_value = CharArray::new(tmp);
24284 let tmp = buf.get_u8()?;
24285 __struct.param_type =
24286 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24287 enum_type: "MavParamExtType",
24288 value: tmp as u64,
24289 })?;
24290 Ok(__struct)
24291 }
24292 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24293 let mut __tmp = BytesMut::new(bytes);
24294 #[allow(clippy::absurd_extreme_comparisons)]
24295 #[allow(unused_comparisons)]
24296 if __tmp.remaining() < Self::ENCODED_LEN {
24297 panic!(
24298 "buffer is too small (need {} bytes, but got {})",
24299 Self::ENCODED_LEN,
24300 __tmp.remaining(),
24301 )
24302 }
24303 __tmp.put_u8(self.target_system);
24304 __tmp.put_u8(self.target_component);
24305 for val in &self.param_id {
24306 __tmp.put_u8(*val);
24307 }
24308 for val in &self.param_value {
24309 __tmp.put_u8(*val);
24310 }
24311 __tmp.put_u8(self.param_type as u8);
24312 if matches!(version, MavlinkVersion::V2) {
24313 let len = __tmp.len();
24314 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24315 } else {
24316 __tmp.len()
24317 }
24318 }
24319}
24320#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
24321#[doc = ""]
24322#[doc = "ID: 322"]
24323#[derive(Debug, Clone, PartialEq)]
24324#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24325#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24326#[cfg_attr(feature = "ts", derive(TS))]
24327#[cfg_attr(feature = "ts", ts(export))]
24328pub struct PARAM_EXT_VALUE_DATA {
24329 #[doc = "Total number of parameters"]
24330 pub param_count: u16,
24331 #[doc = "Index of this parameter"]
24332 pub param_index: u16,
24333 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24334 #[cfg_attr(feature = "ts", ts(type = "string"))]
24335 pub param_id: CharArray<16>,
24336 #[doc = "Parameter value"]
24337 #[cfg_attr(feature = "ts", ts(type = "string"))]
24338 pub param_value: CharArray<128>,
24339 #[doc = "Parameter type."]
24340 pub param_type: MavParamExtType,
24341}
24342impl PARAM_EXT_VALUE_DATA {
24343 pub const ENCODED_LEN: usize = 149usize;
24344 pub const DEFAULT: Self = Self {
24345 param_count: 0_u16,
24346 param_index: 0_u16,
24347 param_id: CharArray::new([0_u8; 16usize]),
24348 param_value: CharArray::new([0_u8; 128usize]),
24349 param_type: MavParamExtType::DEFAULT,
24350 };
24351 #[cfg(feature = "arbitrary")]
24352 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24353 use arbitrary::{Arbitrary, Unstructured};
24354 let mut buf = [0u8; 1024];
24355 rng.fill_bytes(&mut buf);
24356 let mut unstructured = Unstructured::new(&buf);
24357 Self::arbitrary(&mut unstructured).unwrap_or_default()
24358 }
24359}
24360impl Default for PARAM_EXT_VALUE_DATA {
24361 fn default() -> Self {
24362 Self::DEFAULT.clone()
24363 }
24364}
24365impl MessageData for PARAM_EXT_VALUE_DATA {
24366 type Message = MavMessage;
24367 const ID: u32 = 322u32;
24368 const NAME: &'static str = "PARAM_EXT_VALUE";
24369 const EXTRA_CRC: u8 = 243u8;
24370 const ENCODED_LEN: usize = 149usize;
24371 fn deser(
24372 _version: MavlinkVersion,
24373 __input: &[u8],
24374 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24375 let avail_len = __input.len();
24376 let mut payload_buf = [0; Self::ENCODED_LEN];
24377 let mut buf = if avail_len < Self::ENCODED_LEN {
24378 payload_buf[0..avail_len].copy_from_slice(__input);
24379 Bytes::new(&payload_buf)
24380 } else {
24381 Bytes::new(__input)
24382 };
24383 let mut __struct = Self::default();
24384 __struct.param_count = buf.get_u16_le()?;
24385 __struct.param_index = buf.get_u16_le()?;
24386 let mut tmp = [0_u8; 16usize];
24387 for v in &mut tmp {
24388 *v = buf.get_u8()?;
24389 }
24390 __struct.param_id = CharArray::new(tmp);
24391 let mut tmp = [0_u8; 128usize];
24392 for v in &mut tmp {
24393 *v = buf.get_u8()?;
24394 }
24395 __struct.param_value = CharArray::new(tmp);
24396 let tmp = buf.get_u8()?;
24397 __struct.param_type =
24398 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24399 enum_type: "MavParamExtType",
24400 value: tmp as u64,
24401 })?;
24402 Ok(__struct)
24403 }
24404 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24405 let mut __tmp = BytesMut::new(bytes);
24406 #[allow(clippy::absurd_extreme_comparisons)]
24407 #[allow(unused_comparisons)]
24408 if __tmp.remaining() < Self::ENCODED_LEN {
24409 panic!(
24410 "buffer is too small (need {} bytes, but got {})",
24411 Self::ENCODED_LEN,
24412 __tmp.remaining(),
24413 )
24414 }
24415 __tmp.put_u16_le(self.param_count);
24416 __tmp.put_u16_le(self.param_index);
24417 for val in &self.param_id {
24418 __tmp.put_u8(*val);
24419 }
24420 for val in &self.param_value {
24421 __tmp.put_u8(*val);
24422 }
24423 __tmp.put_u8(self.param_type as u8);
24424 if matches!(version, MavlinkVersion::V2) {
24425 let len = __tmp.len();
24426 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24427 } else {
24428 __tmp.len()
24429 }
24430 }
24431}
24432#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
24433#[doc = ""]
24434#[doc = "ID: 50"]
24435#[derive(Debug, Clone, PartialEq)]
24436#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24437#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24438#[cfg_attr(feature = "ts", derive(TS))]
24439#[cfg_attr(feature = "ts", ts(export))]
24440pub struct PARAM_MAP_RC_DATA {
24441 #[doc = "Initial parameter value"]
24442 pub param_value0: f32,
24443 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
24444 pub scale: f32,
24445 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
24446 pub param_value_min: f32,
24447 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
24448 pub param_value_max: f32,
24449 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
24450 pub param_index: i16,
24451 #[doc = "System ID"]
24452 pub target_system: u8,
24453 #[doc = "Component ID"]
24454 pub target_component: u8,
24455 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24456 #[cfg_attr(feature = "ts", ts(type = "string"))]
24457 pub param_id: CharArray<16>,
24458 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
24459 pub parameter_rc_channel_index: u8,
24460}
24461impl PARAM_MAP_RC_DATA {
24462 pub const ENCODED_LEN: usize = 37usize;
24463 pub const DEFAULT: Self = Self {
24464 param_value0: 0.0_f32,
24465 scale: 0.0_f32,
24466 param_value_min: 0.0_f32,
24467 param_value_max: 0.0_f32,
24468 param_index: 0_i16,
24469 target_system: 0_u8,
24470 target_component: 0_u8,
24471 param_id: CharArray::new([0_u8; 16usize]),
24472 parameter_rc_channel_index: 0_u8,
24473 };
24474 #[cfg(feature = "arbitrary")]
24475 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24476 use arbitrary::{Arbitrary, Unstructured};
24477 let mut buf = [0u8; 1024];
24478 rng.fill_bytes(&mut buf);
24479 let mut unstructured = Unstructured::new(&buf);
24480 Self::arbitrary(&mut unstructured).unwrap_or_default()
24481 }
24482}
24483impl Default for PARAM_MAP_RC_DATA {
24484 fn default() -> Self {
24485 Self::DEFAULT.clone()
24486 }
24487}
24488impl MessageData for PARAM_MAP_RC_DATA {
24489 type Message = MavMessage;
24490 const ID: u32 = 50u32;
24491 const NAME: &'static str = "PARAM_MAP_RC";
24492 const EXTRA_CRC: u8 = 78u8;
24493 const ENCODED_LEN: usize = 37usize;
24494 fn deser(
24495 _version: MavlinkVersion,
24496 __input: &[u8],
24497 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24498 let avail_len = __input.len();
24499 let mut payload_buf = [0; Self::ENCODED_LEN];
24500 let mut buf = if avail_len < Self::ENCODED_LEN {
24501 payload_buf[0..avail_len].copy_from_slice(__input);
24502 Bytes::new(&payload_buf)
24503 } else {
24504 Bytes::new(__input)
24505 };
24506 let mut __struct = Self::default();
24507 __struct.param_value0 = buf.get_f32_le()?;
24508 __struct.scale = buf.get_f32_le()?;
24509 __struct.param_value_min = buf.get_f32_le()?;
24510 __struct.param_value_max = buf.get_f32_le()?;
24511 __struct.param_index = buf.get_i16_le()?;
24512 __struct.target_system = buf.get_u8()?;
24513 __struct.target_component = buf.get_u8()?;
24514 let mut tmp = [0_u8; 16usize];
24515 for v in &mut tmp {
24516 *v = buf.get_u8()?;
24517 }
24518 __struct.param_id = CharArray::new(tmp);
24519 __struct.parameter_rc_channel_index = buf.get_u8()?;
24520 Ok(__struct)
24521 }
24522 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24523 let mut __tmp = BytesMut::new(bytes);
24524 #[allow(clippy::absurd_extreme_comparisons)]
24525 #[allow(unused_comparisons)]
24526 if __tmp.remaining() < Self::ENCODED_LEN {
24527 panic!(
24528 "buffer is too small (need {} bytes, but got {})",
24529 Self::ENCODED_LEN,
24530 __tmp.remaining(),
24531 )
24532 }
24533 __tmp.put_f32_le(self.param_value0);
24534 __tmp.put_f32_le(self.scale);
24535 __tmp.put_f32_le(self.param_value_min);
24536 __tmp.put_f32_le(self.param_value_max);
24537 __tmp.put_i16_le(self.param_index);
24538 __tmp.put_u8(self.target_system);
24539 __tmp.put_u8(self.target_component);
24540 for val in &self.param_id {
24541 __tmp.put_u8(*val);
24542 }
24543 __tmp.put_u8(self.parameter_rc_channel_index);
24544 if matches!(version, MavlinkVersion::V2) {
24545 let len = __tmp.len();
24546 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24547 } else {
24548 __tmp.len()
24549 }
24550 }
24551}
24552#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24553#[doc = ""]
24554#[doc = "ID: 21"]
24555#[derive(Debug, Clone, PartialEq)]
24556#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24557#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24558#[cfg_attr(feature = "ts", derive(TS))]
24559#[cfg_attr(feature = "ts", ts(export))]
24560pub struct PARAM_REQUEST_LIST_DATA {
24561 #[doc = "System ID"]
24562 pub target_system: u8,
24563 #[doc = "Component ID"]
24564 pub target_component: u8,
24565}
24566impl PARAM_REQUEST_LIST_DATA {
24567 pub const ENCODED_LEN: usize = 2usize;
24568 pub const DEFAULT: Self = Self {
24569 target_system: 0_u8,
24570 target_component: 0_u8,
24571 };
24572 #[cfg(feature = "arbitrary")]
24573 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24574 use arbitrary::{Arbitrary, Unstructured};
24575 let mut buf = [0u8; 1024];
24576 rng.fill_bytes(&mut buf);
24577 let mut unstructured = Unstructured::new(&buf);
24578 Self::arbitrary(&mut unstructured).unwrap_or_default()
24579 }
24580}
24581impl Default for PARAM_REQUEST_LIST_DATA {
24582 fn default() -> Self {
24583 Self::DEFAULT.clone()
24584 }
24585}
24586impl MessageData for PARAM_REQUEST_LIST_DATA {
24587 type Message = MavMessage;
24588 const ID: u32 = 21u32;
24589 const NAME: &'static str = "PARAM_REQUEST_LIST";
24590 const EXTRA_CRC: u8 = 159u8;
24591 const ENCODED_LEN: usize = 2usize;
24592 fn deser(
24593 _version: MavlinkVersion,
24594 __input: &[u8],
24595 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24596 let avail_len = __input.len();
24597 let mut payload_buf = [0; Self::ENCODED_LEN];
24598 let mut buf = if avail_len < Self::ENCODED_LEN {
24599 payload_buf[0..avail_len].copy_from_slice(__input);
24600 Bytes::new(&payload_buf)
24601 } else {
24602 Bytes::new(__input)
24603 };
24604 let mut __struct = Self::default();
24605 __struct.target_system = buf.get_u8()?;
24606 __struct.target_component = buf.get_u8()?;
24607 Ok(__struct)
24608 }
24609 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24610 let mut __tmp = BytesMut::new(bytes);
24611 #[allow(clippy::absurd_extreme_comparisons)]
24612 #[allow(unused_comparisons)]
24613 if __tmp.remaining() < Self::ENCODED_LEN {
24614 panic!(
24615 "buffer is too small (need {} bytes, but got {})",
24616 Self::ENCODED_LEN,
24617 __tmp.remaining(),
24618 )
24619 }
24620 __tmp.put_u8(self.target_system);
24621 __tmp.put_u8(self.target_component);
24622 if matches!(version, MavlinkVersion::V2) {
24623 let len = __tmp.len();
24624 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24625 } else {
24626 __tmp.len()
24627 }
24628 }
24629}
24630#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
24631#[doc = ""]
24632#[doc = "ID: 20"]
24633#[derive(Debug, Clone, PartialEq)]
24634#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24635#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24636#[cfg_attr(feature = "ts", derive(TS))]
24637#[cfg_attr(feature = "ts", ts(export))]
24638pub struct PARAM_REQUEST_READ_DATA {
24639 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
24640 pub param_index: i16,
24641 #[doc = "System ID"]
24642 pub target_system: u8,
24643 #[doc = "Component ID"]
24644 pub target_component: u8,
24645 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24646 #[cfg_attr(feature = "ts", ts(type = "string"))]
24647 pub param_id: CharArray<16>,
24648}
24649impl PARAM_REQUEST_READ_DATA {
24650 pub const ENCODED_LEN: usize = 20usize;
24651 pub const DEFAULT: Self = Self {
24652 param_index: 0_i16,
24653 target_system: 0_u8,
24654 target_component: 0_u8,
24655 param_id: CharArray::new([0_u8; 16usize]),
24656 };
24657 #[cfg(feature = "arbitrary")]
24658 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24659 use arbitrary::{Arbitrary, Unstructured};
24660 let mut buf = [0u8; 1024];
24661 rng.fill_bytes(&mut buf);
24662 let mut unstructured = Unstructured::new(&buf);
24663 Self::arbitrary(&mut unstructured).unwrap_or_default()
24664 }
24665}
24666impl Default for PARAM_REQUEST_READ_DATA {
24667 fn default() -> Self {
24668 Self::DEFAULT.clone()
24669 }
24670}
24671impl MessageData for PARAM_REQUEST_READ_DATA {
24672 type Message = MavMessage;
24673 const ID: u32 = 20u32;
24674 const NAME: &'static str = "PARAM_REQUEST_READ";
24675 const EXTRA_CRC: u8 = 214u8;
24676 const ENCODED_LEN: usize = 20usize;
24677 fn deser(
24678 _version: MavlinkVersion,
24679 __input: &[u8],
24680 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24681 let avail_len = __input.len();
24682 let mut payload_buf = [0; Self::ENCODED_LEN];
24683 let mut buf = if avail_len < Self::ENCODED_LEN {
24684 payload_buf[0..avail_len].copy_from_slice(__input);
24685 Bytes::new(&payload_buf)
24686 } else {
24687 Bytes::new(__input)
24688 };
24689 let mut __struct = Self::default();
24690 __struct.param_index = buf.get_i16_le()?;
24691 __struct.target_system = buf.get_u8()?;
24692 __struct.target_component = buf.get_u8()?;
24693 let mut tmp = [0_u8; 16usize];
24694 for v in &mut tmp {
24695 *v = buf.get_u8()?;
24696 }
24697 __struct.param_id = CharArray::new(tmp);
24698 Ok(__struct)
24699 }
24700 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24701 let mut __tmp = BytesMut::new(bytes);
24702 #[allow(clippy::absurd_extreme_comparisons)]
24703 #[allow(unused_comparisons)]
24704 if __tmp.remaining() < Self::ENCODED_LEN {
24705 panic!(
24706 "buffer is too small (need {} bytes, but got {})",
24707 Self::ENCODED_LEN,
24708 __tmp.remaining(),
24709 )
24710 }
24711 __tmp.put_i16_le(self.param_index);
24712 __tmp.put_u8(self.target_system);
24713 __tmp.put_u8(self.target_component);
24714 for val in &self.param_id {
24715 __tmp.put_u8(*val);
24716 }
24717 if matches!(version, MavlinkVersion::V2) {
24718 let len = __tmp.len();
24719 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24720 } else {
24721 __tmp.len()
24722 }
24723 }
24724}
24725#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24726#[doc = ""]
24727#[doc = "ID: 23"]
24728#[derive(Debug, Clone, PartialEq)]
24729#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24730#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24731#[cfg_attr(feature = "ts", derive(TS))]
24732#[cfg_attr(feature = "ts", ts(export))]
24733pub struct PARAM_SET_DATA {
24734 #[doc = "Onboard parameter value"]
24735 pub param_value: f32,
24736 #[doc = "System ID"]
24737 pub target_system: u8,
24738 #[doc = "Component ID"]
24739 pub target_component: u8,
24740 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24741 #[cfg_attr(feature = "ts", ts(type = "string"))]
24742 pub param_id: CharArray<16>,
24743 #[doc = "Onboard parameter type."]
24744 pub param_type: MavParamType,
24745}
24746impl PARAM_SET_DATA {
24747 pub const ENCODED_LEN: usize = 23usize;
24748 pub const DEFAULT: Self = Self {
24749 param_value: 0.0_f32,
24750 target_system: 0_u8,
24751 target_component: 0_u8,
24752 param_id: CharArray::new([0_u8; 16usize]),
24753 param_type: MavParamType::DEFAULT,
24754 };
24755 #[cfg(feature = "arbitrary")]
24756 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24757 use arbitrary::{Arbitrary, Unstructured};
24758 let mut buf = [0u8; 1024];
24759 rng.fill_bytes(&mut buf);
24760 let mut unstructured = Unstructured::new(&buf);
24761 Self::arbitrary(&mut unstructured).unwrap_or_default()
24762 }
24763}
24764impl Default for PARAM_SET_DATA {
24765 fn default() -> Self {
24766 Self::DEFAULT.clone()
24767 }
24768}
24769impl MessageData for PARAM_SET_DATA {
24770 type Message = MavMessage;
24771 const ID: u32 = 23u32;
24772 const NAME: &'static str = "PARAM_SET";
24773 const EXTRA_CRC: u8 = 168u8;
24774 const ENCODED_LEN: usize = 23usize;
24775 fn deser(
24776 _version: MavlinkVersion,
24777 __input: &[u8],
24778 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24779 let avail_len = __input.len();
24780 let mut payload_buf = [0; Self::ENCODED_LEN];
24781 let mut buf = if avail_len < Self::ENCODED_LEN {
24782 payload_buf[0..avail_len].copy_from_slice(__input);
24783 Bytes::new(&payload_buf)
24784 } else {
24785 Bytes::new(__input)
24786 };
24787 let mut __struct = Self::default();
24788 __struct.param_value = buf.get_f32_le()?;
24789 __struct.target_system = buf.get_u8()?;
24790 __struct.target_component = buf.get_u8()?;
24791 let mut tmp = [0_u8; 16usize];
24792 for v in &mut tmp {
24793 *v = buf.get_u8()?;
24794 }
24795 __struct.param_id = CharArray::new(tmp);
24796 let tmp = buf.get_u8()?;
24797 __struct.param_type =
24798 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24799 enum_type: "MavParamType",
24800 value: tmp as u64,
24801 })?;
24802 Ok(__struct)
24803 }
24804 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24805 let mut __tmp = BytesMut::new(bytes);
24806 #[allow(clippy::absurd_extreme_comparisons)]
24807 #[allow(unused_comparisons)]
24808 if __tmp.remaining() < Self::ENCODED_LEN {
24809 panic!(
24810 "buffer is too small (need {} bytes, but got {})",
24811 Self::ENCODED_LEN,
24812 __tmp.remaining(),
24813 )
24814 }
24815 __tmp.put_f32_le(self.param_value);
24816 __tmp.put_u8(self.target_system);
24817 __tmp.put_u8(self.target_component);
24818 for val in &self.param_id {
24819 __tmp.put_u8(*val);
24820 }
24821 __tmp.put_u8(self.param_type as u8);
24822 if matches!(version, MavlinkVersion::V2) {
24823 let len = __tmp.len();
24824 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24825 } else {
24826 __tmp.len()
24827 }
24828 }
24829}
24830#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24831#[doc = ""]
24832#[doc = "ID: 22"]
24833#[derive(Debug, Clone, PartialEq)]
24834#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24835#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24836#[cfg_attr(feature = "ts", derive(TS))]
24837#[cfg_attr(feature = "ts", ts(export))]
24838pub struct PARAM_VALUE_DATA {
24839 #[doc = "Onboard parameter value"]
24840 pub param_value: f32,
24841 #[doc = "Total number of onboard parameters"]
24842 pub param_count: u16,
24843 #[doc = "Index of this onboard parameter"]
24844 pub param_index: u16,
24845 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24846 #[cfg_attr(feature = "ts", ts(type = "string"))]
24847 pub param_id: CharArray<16>,
24848 #[doc = "Onboard parameter type."]
24849 pub param_type: MavParamType,
24850}
24851impl PARAM_VALUE_DATA {
24852 pub const ENCODED_LEN: usize = 25usize;
24853 pub const DEFAULT: Self = Self {
24854 param_value: 0.0_f32,
24855 param_count: 0_u16,
24856 param_index: 0_u16,
24857 param_id: CharArray::new([0_u8; 16usize]),
24858 param_type: MavParamType::DEFAULT,
24859 };
24860 #[cfg(feature = "arbitrary")]
24861 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24862 use arbitrary::{Arbitrary, Unstructured};
24863 let mut buf = [0u8; 1024];
24864 rng.fill_bytes(&mut buf);
24865 let mut unstructured = Unstructured::new(&buf);
24866 Self::arbitrary(&mut unstructured).unwrap_or_default()
24867 }
24868}
24869impl Default for PARAM_VALUE_DATA {
24870 fn default() -> Self {
24871 Self::DEFAULT.clone()
24872 }
24873}
24874impl MessageData for PARAM_VALUE_DATA {
24875 type Message = MavMessage;
24876 const ID: u32 = 22u32;
24877 const NAME: &'static str = "PARAM_VALUE";
24878 const EXTRA_CRC: u8 = 220u8;
24879 const ENCODED_LEN: usize = 25usize;
24880 fn deser(
24881 _version: MavlinkVersion,
24882 __input: &[u8],
24883 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24884 let avail_len = __input.len();
24885 let mut payload_buf = [0; Self::ENCODED_LEN];
24886 let mut buf = if avail_len < Self::ENCODED_LEN {
24887 payload_buf[0..avail_len].copy_from_slice(__input);
24888 Bytes::new(&payload_buf)
24889 } else {
24890 Bytes::new(__input)
24891 };
24892 let mut __struct = Self::default();
24893 __struct.param_value = buf.get_f32_le()?;
24894 __struct.param_count = buf.get_u16_le()?;
24895 __struct.param_index = buf.get_u16_le()?;
24896 let mut tmp = [0_u8; 16usize];
24897 for v in &mut tmp {
24898 *v = buf.get_u8()?;
24899 }
24900 __struct.param_id = CharArray::new(tmp);
24901 let tmp = buf.get_u8()?;
24902 __struct.param_type =
24903 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24904 enum_type: "MavParamType",
24905 value: tmp as u64,
24906 })?;
24907 Ok(__struct)
24908 }
24909 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24910 let mut __tmp = BytesMut::new(bytes);
24911 #[allow(clippy::absurd_extreme_comparisons)]
24912 #[allow(unused_comparisons)]
24913 if __tmp.remaining() < Self::ENCODED_LEN {
24914 panic!(
24915 "buffer is too small (need {} bytes, but got {})",
24916 Self::ENCODED_LEN,
24917 __tmp.remaining(),
24918 )
24919 }
24920 __tmp.put_f32_le(self.param_value);
24921 __tmp.put_u16_le(self.param_count);
24922 __tmp.put_u16_le(self.param_index);
24923 for val in &self.param_id {
24924 __tmp.put_u8(*val);
24925 }
24926 __tmp.put_u8(self.param_type as u8);
24927 if matches!(version, MavlinkVersion::V2) {
24928 let len = __tmp.len();
24929 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24930 } else {
24931 __tmp.len()
24932 }
24933 }
24934}
24935#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
24936#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
24937#[doc = ""]
24938#[doc = "ID: 4"]
24939#[derive(Debug, Clone, PartialEq)]
24940#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24941#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24942#[cfg_attr(feature = "ts", derive(TS))]
24943#[cfg_attr(feature = "ts", ts(export))]
24944pub struct PING_DATA {
24945 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24946 pub time_usec: u64,
24947 #[doc = "PING sequence"]
24948 pub seq: u32,
24949 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
24950 pub target_system: u8,
24951 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
24952 pub target_component: u8,
24953}
24954impl PING_DATA {
24955 pub const ENCODED_LEN: usize = 14usize;
24956 pub const DEFAULT: Self = Self {
24957 time_usec: 0_u64,
24958 seq: 0_u32,
24959 target_system: 0_u8,
24960 target_component: 0_u8,
24961 };
24962 #[cfg(feature = "arbitrary")]
24963 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24964 use arbitrary::{Arbitrary, Unstructured};
24965 let mut buf = [0u8; 1024];
24966 rng.fill_bytes(&mut buf);
24967 let mut unstructured = Unstructured::new(&buf);
24968 Self::arbitrary(&mut unstructured).unwrap_or_default()
24969 }
24970}
24971impl Default for PING_DATA {
24972 fn default() -> Self {
24973 Self::DEFAULT.clone()
24974 }
24975}
24976impl MessageData for PING_DATA {
24977 type Message = MavMessage;
24978 const ID: u32 = 4u32;
24979 const NAME: &'static str = "PING";
24980 const EXTRA_CRC: u8 = 237u8;
24981 const ENCODED_LEN: usize = 14usize;
24982 fn deser(
24983 _version: MavlinkVersion,
24984 __input: &[u8],
24985 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24986 let avail_len = __input.len();
24987 let mut payload_buf = [0; Self::ENCODED_LEN];
24988 let mut buf = if avail_len < Self::ENCODED_LEN {
24989 payload_buf[0..avail_len].copy_from_slice(__input);
24990 Bytes::new(&payload_buf)
24991 } else {
24992 Bytes::new(__input)
24993 };
24994 let mut __struct = Self::default();
24995 __struct.time_usec = buf.get_u64_le()?;
24996 __struct.seq = buf.get_u32_le()?;
24997 __struct.target_system = buf.get_u8()?;
24998 __struct.target_component = buf.get_u8()?;
24999 Ok(__struct)
25000 }
25001 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25002 let mut __tmp = BytesMut::new(bytes);
25003 #[allow(clippy::absurd_extreme_comparisons)]
25004 #[allow(unused_comparisons)]
25005 if __tmp.remaining() < Self::ENCODED_LEN {
25006 panic!(
25007 "buffer is too small (need {} bytes, but got {})",
25008 Self::ENCODED_LEN,
25009 __tmp.remaining(),
25010 )
25011 }
25012 __tmp.put_u64_le(self.time_usec);
25013 __tmp.put_u32_le(self.seq);
25014 __tmp.put_u8(self.target_system);
25015 __tmp.put_u8(self.target_component);
25016 if matches!(version, MavlinkVersion::V2) {
25017 let len = __tmp.len();
25018 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25019 } else {
25020 __tmp.len()
25021 }
25022 }
25023}
25024#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
25025#[doc = "Control vehicle tone generation (buzzer)."]
25026#[doc = ""]
25027#[doc = "ID: 258"]
25028#[derive(Debug, Clone, PartialEq)]
25029#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25030#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25031#[cfg_attr(feature = "ts", derive(TS))]
25032#[cfg_attr(feature = "ts", ts(export))]
25033pub struct PLAY_TUNE_DATA {
25034 #[doc = "System ID"]
25035 pub target_system: u8,
25036 #[doc = "Component ID"]
25037 pub target_component: u8,
25038 #[doc = "tune in board specific format"]
25039 #[cfg_attr(feature = "ts", ts(type = "string"))]
25040 pub tune: CharArray<30>,
25041 #[doc = "tune extension (appended to tune)"]
25042 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25043 #[cfg_attr(feature = "ts", ts(type = "string"))]
25044 pub tune2: CharArray<200>,
25045}
25046impl PLAY_TUNE_DATA {
25047 pub const ENCODED_LEN: usize = 232usize;
25048 pub const DEFAULT: Self = Self {
25049 target_system: 0_u8,
25050 target_component: 0_u8,
25051 tune: CharArray::new([0_u8; 30usize]),
25052 tune2: CharArray::new([0_u8; 200usize]),
25053 };
25054 #[cfg(feature = "arbitrary")]
25055 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25056 use arbitrary::{Arbitrary, Unstructured};
25057 let mut buf = [0u8; 1024];
25058 rng.fill_bytes(&mut buf);
25059 let mut unstructured = Unstructured::new(&buf);
25060 Self::arbitrary(&mut unstructured).unwrap_or_default()
25061 }
25062}
25063impl Default for PLAY_TUNE_DATA {
25064 fn default() -> Self {
25065 Self::DEFAULT.clone()
25066 }
25067}
25068impl MessageData for PLAY_TUNE_DATA {
25069 type Message = MavMessage;
25070 const ID: u32 = 258u32;
25071 const NAME: &'static str = "PLAY_TUNE";
25072 const EXTRA_CRC: u8 = 187u8;
25073 const ENCODED_LEN: usize = 232usize;
25074 fn deser(
25075 _version: MavlinkVersion,
25076 __input: &[u8],
25077 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25078 let avail_len = __input.len();
25079 let mut payload_buf = [0; Self::ENCODED_LEN];
25080 let mut buf = if avail_len < Self::ENCODED_LEN {
25081 payload_buf[0..avail_len].copy_from_slice(__input);
25082 Bytes::new(&payload_buf)
25083 } else {
25084 Bytes::new(__input)
25085 };
25086 let mut __struct = Self::default();
25087 __struct.target_system = buf.get_u8()?;
25088 __struct.target_component = buf.get_u8()?;
25089 let mut tmp = [0_u8; 30usize];
25090 for v in &mut tmp {
25091 *v = buf.get_u8()?;
25092 }
25093 __struct.tune = CharArray::new(tmp);
25094 let mut tmp = [0_u8; 200usize];
25095 for v in &mut tmp {
25096 *v = buf.get_u8()?;
25097 }
25098 __struct.tune2 = CharArray::new(tmp);
25099 Ok(__struct)
25100 }
25101 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25102 let mut __tmp = BytesMut::new(bytes);
25103 #[allow(clippy::absurd_extreme_comparisons)]
25104 #[allow(unused_comparisons)]
25105 if __tmp.remaining() < Self::ENCODED_LEN {
25106 panic!(
25107 "buffer is too small (need {} bytes, but got {})",
25108 Self::ENCODED_LEN,
25109 __tmp.remaining(),
25110 )
25111 }
25112 __tmp.put_u8(self.target_system);
25113 __tmp.put_u8(self.target_component);
25114 for val in &self.tune {
25115 __tmp.put_u8(*val);
25116 }
25117 if matches!(version, MavlinkVersion::V2) {
25118 for val in &self.tune2 {
25119 __tmp.put_u8(*val);
25120 }
25121 let len = __tmp.len();
25122 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25123 } else {
25124 __tmp.len()
25125 }
25126 }
25127}
25128#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
25129#[doc = ""]
25130#[doc = "ID: 400"]
25131#[derive(Debug, Clone, PartialEq)]
25132#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25133#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25134#[cfg_attr(feature = "ts", derive(TS))]
25135#[cfg_attr(feature = "ts", ts(export))]
25136pub struct PLAY_TUNE_V2_DATA {
25137 #[doc = "Tune format"]
25138 pub format: TuneFormat,
25139 #[doc = "System ID"]
25140 pub target_system: u8,
25141 #[doc = "Component ID"]
25142 pub target_component: u8,
25143 #[doc = "Tune definition as a NULL-terminated string."]
25144 #[cfg_attr(feature = "ts", ts(type = "string"))]
25145 pub tune: CharArray<248>,
25146}
25147impl PLAY_TUNE_V2_DATA {
25148 pub const ENCODED_LEN: usize = 254usize;
25149 pub const DEFAULT: Self = Self {
25150 format: TuneFormat::DEFAULT,
25151 target_system: 0_u8,
25152 target_component: 0_u8,
25153 tune: CharArray::new([0_u8; 248usize]),
25154 };
25155 #[cfg(feature = "arbitrary")]
25156 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25157 use arbitrary::{Arbitrary, Unstructured};
25158 let mut buf = [0u8; 1024];
25159 rng.fill_bytes(&mut buf);
25160 let mut unstructured = Unstructured::new(&buf);
25161 Self::arbitrary(&mut unstructured).unwrap_or_default()
25162 }
25163}
25164impl Default for PLAY_TUNE_V2_DATA {
25165 fn default() -> Self {
25166 Self::DEFAULT.clone()
25167 }
25168}
25169impl MessageData for PLAY_TUNE_V2_DATA {
25170 type Message = MavMessage;
25171 const ID: u32 = 400u32;
25172 const NAME: &'static str = "PLAY_TUNE_V2";
25173 const EXTRA_CRC: u8 = 110u8;
25174 const ENCODED_LEN: usize = 254usize;
25175 fn deser(
25176 _version: MavlinkVersion,
25177 __input: &[u8],
25178 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25179 let avail_len = __input.len();
25180 let mut payload_buf = [0; Self::ENCODED_LEN];
25181 let mut buf = if avail_len < Self::ENCODED_LEN {
25182 payload_buf[0..avail_len].copy_from_slice(__input);
25183 Bytes::new(&payload_buf)
25184 } else {
25185 Bytes::new(__input)
25186 };
25187 let mut __struct = Self::default();
25188 let tmp = buf.get_u32_le()?;
25189 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
25190 ::mavlink_core::error::ParserError::InvalidEnum {
25191 enum_type: "TuneFormat",
25192 value: tmp as u64,
25193 },
25194 )?;
25195 __struct.target_system = buf.get_u8()?;
25196 __struct.target_component = buf.get_u8()?;
25197 let mut tmp = [0_u8; 248usize];
25198 for v in &mut tmp {
25199 *v = buf.get_u8()?;
25200 }
25201 __struct.tune = CharArray::new(tmp);
25202 Ok(__struct)
25203 }
25204 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25205 let mut __tmp = BytesMut::new(bytes);
25206 #[allow(clippy::absurd_extreme_comparisons)]
25207 #[allow(unused_comparisons)]
25208 if __tmp.remaining() < Self::ENCODED_LEN {
25209 panic!(
25210 "buffer is too small (need {} bytes, but got {})",
25211 Self::ENCODED_LEN,
25212 __tmp.remaining(),
25213 )
25214 }
25215 __tmp.put_u32_le(self.format as u32);
25216 __tmp.put_u8(self.target_system);
25217 __tmp.put_u8(self.target_component);
25218 for val in &self.tune {
25219 __tmp.put_u8(*val);
25220 }
25221 if matches!(version, MavlinkVersion::V2) {
25222 let len = __tmp.len();
25223 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25224 } else {
25225 __tmp.len()
25226 }
25227 }
25228}
25229#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
25230#[doc = ""]
25231#[doc = "ID: 87"]
25232#[derive(Debug, Clone, PartialEq)]
25233#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25234#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25235#[cfg_attr(feature = "ts", derive(TS))]
25236#[cfg_attr(feature = "ts", ts(export))]
25237pub struct POSITION_TARGET_GLOBAL_INT_DATA {
25238 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
25239 pub time_boot_ms: u32,
25240 #[doc = "Latitude in WGS84 frame"]
25241 pub lat_int: i32,
25242 #[doc = "Longitude in WGS84 frame"]
25243 pub lon_int: i32,
25244 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
25245 pub alt: f32,
25246 #[doc = "X velocity in NED frame"]
25247 pub vx: f32,
25248 #[doc = "Y velocity in NED frame"]
25249 pub vy: f32,
25250 #[doc = "Z velocity in NED frame"]
25251 pub vz: f32,
25252 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25253 pub afx: f32,
25254 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25255 pub afy: f32,
25256 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25257 pub afz: f32,
25258 #[doc = "yaw setpoint"]
25259 pub yaw: f32,
25260 #[doc = "yaw rate setpoint"]
25261 pub yaw_rate: f32,
25262 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
25263 pub type_mask: PositionTargetTypemask,
25264 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
25265 pub coordinate_frame: MavFrame,
25266}
25267impl POSITION_TARGET_GLOBAL_INT_DATA {
25268 pub const ENCODED_LEN: usize = 51usize;
25269 pub const DEFAULT: Self = Self {
25270 time_boot_ms: 0_u32,
25271 lat_int: 0_i32,
25272 lon_int: 0_i32,
25273 alt: 0.0_f32,
25274 vx: 0.0_f32,
25275 vy: 0.0_f32,
25276 vz: 0.0_f32,
25277 afx: 0.0_f32,
25278 afy: 0.0_f32,
25279 afz: 0.0_f32,
25280 yaw: 0.0_f32,
25281 yaw_rate: 0.0_f32,
25282 type_mask: PositionTargetTypemask::DEFAULT,
25283 coordinate_frame: MavFrame::DEFAULT,
25284 };
25285 #[cfg(feature = "arbitrary")]
25286 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25287 use arbitrary::{Arbitrary, Unstructured};
25288 let mut buf = [0u8; 1024];
25289 rng.fill_bytes(&mut buf);
25290 let mut unstructured = Unstructured::new(&buf);
25291 Self::arbitrary(&mut unstructured).unwrap_or_default()
25292 }
25293}
25294impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
25295 fn default() -> Self {
25296 Self::DEFAULT.clone()
25297 }
25298}
25299impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
25300 type Message = MavMessage;
25301 const ID: u32 = 87u32;
25302 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
25303 const EXTRA_CRC: u8 = 150u8;
25304 const ENCODED_LEN: usize = 51usize;
25305 fn deser(
25306 _version: MavlinkVersion,
25307 __input: &[u8],
25308 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25309 let avail_len = __input.len();
25310 let mut payload_buf = [0; Self::ENCODED_LEN];
25311 let mut buf = if avail_len < Self::ENCODED_LEN {
25312 payload_buf[0..avail_len].copy_from_slice(__input);
25313 Bytes::new(&payload_buf)
25314 } else {
25315 Bytes::new(__input)
25316 };
25317 let mut __struct = Self::default();
25318 __struct.time_boot_ms = buf.get_u32_le()?;
25319 __struct.lat_int = buf.get_i32_le()?;
25320 __struct.lon_int = buf.get_i32_le()?;
25321 __struct.alt = buf.get_f32_le()?;
25322 __struct.vx = buf.get_f32_le()?;
25323 __struct.vy = buf.get_f32_le()?;
25324 __struct.vz = buf.get_f32_le()?;
25325 __struct.afx = buf.get_f32_le()?;
25326 __struct.afy = buf.get_f32_le()?;
25327 __struct.afz = buf.get_f32_le()?;
25328 __struct.yaw = buf.get_f32_le()?;
25329 __struct.yaw_rate = buf.get_f32_le()?;
25330 let tmp = buf.get_u16_le()?;
25331 __struct.type_mask =
25332 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
25333 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
25334 flag_type: "PositionTargetTypemask",
25335 value: tmp as u64,
25336 })?;
25337 let tmp = buf.get_u8()?;
25338 __struct.coordinate_frame =
25339 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25340 enum_type: "MavFrame",
25341 value: tmp as u64,
25342 })?;
25343 Ok(__struct)
25344 }
25345 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25346 let mut __tmp = BytesMut::new(bytes);
25347 #[allow(clippy::absurd_extreme_comparisons)]
25348 #[allow(unused_comparisons)]
25349 if __tmp.remaining() < Self::ENCODED_LEN {
25350 panic!(
25351 "buffer is too small (need {} bytes, but got {})",
25352 Self::ENCODED_LEN,
25353 __tmp.remaining(),
25354 )
25355 }
25356 __tmp.put_u32_le(self.time_boot_ms);
25357 __tmp.put_i32_le(self.lat_int);
25358 __tmp.put_i32_le(self.lon_int);
25359 __tmp.put_f32_le(self.alt);
25360 __tmp.put_f32_le(self.vx);
25361 __tmp.put_f32_le(self.vy);
25362 __tmp.put_f32_le(self.vz);
25363 __tmp.put_f32_le(self.afx);
25364 __tmp.put_f32_le(self.afy);
25365 __tmp.put_f32_le(self.afz);
25366 __tmp.put_f32_le(self.yaw);
25367 __tmp.put_f32_le(self.yaw_rate);
25368 __tmp.put_u16_le(self.type_mask.bits() as u16);
25369 __tmp.put_u8(self.coordinate_frame as u8);
25370 if matches!(version, MavlinkVersion::V2) {
25371 let len = __tmp.len();
25372 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25373 } else {
25374 __tmp.len()
25375 }
25376 }
25377}
25378#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
25379#[doc = ""]
25380#[doc = "ID: 85"]
25381#[derive(Debug, Clone, PartialEq)]
25382#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25383#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25384#[cfg_attr(feature = "ts", derive(TS))]
25385#[cfg_attr(feature = "ts", ts(export))]
25386pub struct POSITION_TARGET_LOCAL_NED_DATA {
25387 #[doc = "Timestamp (time since system boot)."]
25388 pub time_boot_ms: u32,
25389 #[doc = "X Position in NED frame"]
25390 pub x: f32,
25391 #[doc = "Y Position in NED frame"]
25392 pub y: f32,
25393 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
25394 pub z: f32,
25395 #[doc = "X velocity in NED frame"]
25396 pub vx: f32,
25397 #[doc = "Y velocity in NED frame"]
25398 pub vy: f32,
25399 #[doc = "Z velocity in NED frame"]
25400 pub vz: f32,
25401 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25402 pub afx: f32,
25403 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25404 pub afy: f32,
25405 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25406 pub afz: f32,
25407 #[doc = "yaw setpoint"]
25408 pub yaw: f32,
25409 #[doc = "yaw rate setpoint"]
25410 pub yaw_rate: f32,
25411 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
25412 pub type_mask: PositionTargetTypemask,
25413 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
25414 pub coordinate_frame: MavFrame,
25415}
25416impl POSITION_TARGET_LOCAL_NED_DATA {
25417 pub const ENCODED_LEN: usize = 51usize;
25418 pub const DEFAULT: Self = Self {
25419 time_boot_ms: 0_u32,
25420 x: 0.0_f32,
25421 y: 0.0_f32,
25422 z: 0.0_f32,
25423 vx: 0.0_f32,
25424 vy: 0.0_f32,
25425 vz: 0.0_f32,
25426 afx: 0.0_f32,
25427 afy: 0.0_f32,
25428 afz: 0.0_f32,
25429 yaw: 0.0_f32,
25430 yaw_rate: 0.0_f32,
25431 type_mask: PositionTargetTypemask::DEFAULT,
25432 coordinate_frame: MavFrame::DEFAULT,
25433 };
25434 #[cfg(feature = "arbitrary")]
25435 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25436 use arbitrary::{Arbitrary, Unstructured};
25437 let mut buf = [0u8; 1024];
25438 rng.fill_bytes(&mut buf);
25439 let mut unstructured = Unstructured::new(&buf);
25440 Self::arbitrary(&mut unstructured).unwrap_or_default()
25441 }
25442}
25443impl Default for POSITION_TARGET_LOCAL_NED_DATA {
25444 fn default() -> Self {
25445 Self::DEFAULT.clone()
25446 }
25447}
25448impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
25449 type Message = MavMessage;
25450 const ID: u32 = 85u32;
25451 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
25452 const EXTRA_CRC: u8 = 140u8;
25453 const ENCODED_LEN: usize = 51usize;
25454 fn deser(
25455 _version: MavlinkVersion,
25456 __input: &[u8],
25457 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25458 let avail_len = __input.len();
25459 let mut payload_buf = [0; Self::ENCODED_LEN];
25460 let mut buf = if avail_len < Self::ENCODED_LEN {
25461 payload_buf[0..avail_len].copy_from_slice(__input);
25462 Bytes::new(&payload_buf)
25463 } else {
25464 Bytes::new(__input)
25465 };
25466 let mut __struct = Self::default();
25467 __struct.time_boot_ms = buf.get_u32_le()?;
25468 __struct.x = buf.get_f32_le()?;
25469 __struct.y = buf.get_f32_le()?;
25470 __struct.z = buf.get_f32_le()?;
25471 __struct.vx = buf.get_f32_le()?;
25472 __struct.vy = buf.get_f32_le()?;
25473 __struct.vz = buf.get_f32_le()?;
25474 __struct.afx = buf.get_f32_le()?;
25475 __struct.afy = buf.get_f32_le()?;
25476 __struct.afz = buf.get_f32_le()?;
25477 __struct.yaw = buf.get_f32_le()?;
25478 __struct.yaw_rate = buf.get_f32_le()?;
25479 let tmp = buf.get_u16_le()?;
25480 __struct.type_mask =
25481 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
25482 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
25483 flag_type: "PositionTargetTypemask",
25484 value: tmp as u64,
25485 })?;
25486 let tmp = buf.get_u8()?;
25487 __struct.coordinate_frame =
25488 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25489 enum_type: "MavFrame",
25490 value: tmp as u64,
25491 })?;
25492 Ok(__struct)
25493 }
25494 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25495 let mut __tmp = BytesMut::new(bytes);
25496 #[allow(clippy::absurd_extreme_comparisons)]
25497 #[allow(unused_comparisons)]
25498 if __tmp.remaining() < Self::ENCODED_LEN {
25499 panic!(
25500 "buffer is too small (need {} bytes, but got {})",
25501 Self::ENCODED_LEN,
25502 __tmp.remaining(),
25503 )
25504 }
25505 __tmp.put_u32_le(self.time_boot_ms);
25506 __tmp.put_f32_le(self.x);
25507 __tmp.put_f32_le(self.y);
25508 __tmp.put_f32_le(self.z);
25509 __tmp.put_f32_le(self.vx);
25510 __tmp.put_f32_le(self.vy);
25511 __tmp.put_f32_le(self.vz);
25512 __tmp.put_f32_le(self.afx);
25513 __tmp.put_f32_le(self.afy);
25514 __tmp.put_f32_le(self.afz);
25515 __tmp.put_f32_le(self.yaw);
25516 __tmp.put_f32_le(self.yaw_rate);
25517 __tmp.put_u16_le(self.type_mask.bits() as u16);
25518 __tmp.put_u8(self.coordinate_frame as u8);
25519 if matches!(version, MavlinkVersion::V2) {
25520 let len = __tmp.len();
25521 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25522 } else {
25523 __tmp.len()
25524 }
25525 }
25526}
25527#[doc = "Power supply status."]
25528#[doc = ""]
25529#[doc = "ID: 125"]
25530#[derive(Debug, Clone, PartialEq)]
25531#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25532#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25533#[cfg_attr(feature = "ts", derive(TS))]
25534#[cfg_attr(feature = "ts", ts(export))]
25535pub struct POWER_STATUS_DATA {
25536 #[doc = "5V rail voltage."]
25537 pub Vcc: u16,
25538 #[doc = "Servo rail voltage."]
25539 pub Vservo: u16,
25540 #[doc = "Bitmap of power supply status flags."]
25541 pub flags: MavPowerStatus,
25542}
25543impl POWER_STATUS_DATA {
25544 pub const ENCODED_LEN: usize = 6usize;
25545 pub const DEFAULT: Self = Self {
25546 Vcc: 0_u16,
25547 Vservo: 0_u16,
25548 flags: MavPowerStatus::DEFAULT,
25549 };
25550 #[cfg(feature = "arbitrary")]
25551 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25552 use arbitrary::{Arbitrary, Unstructured};
25553 let mut buf = [0u8; 1024];
25554 rng.fill_bytes(&mut buf);
25555 let mut unstructured = Unstructured::new(&buf);
25556 Self::arbitrary(&mut unstructured).unwrap_or_default()
25557 }
25558}
25559impl Default for POWER_STATUS_DATA {
25560 fn default() -> Self {
25561 Self::DEFAULT.clone()
25562 }
25563}
25564impl MessageData for POWER_STATUS_DATA {
25565 type Message = MavMessage;
25566 const ID: u32 = 125u32;
25567 const NAME: &'static str = "POWER_STATUS";
25568 const EXTRA_CRC: u8 = 203u8;
25569 const ENCODED_LEN: usize = 6usize;
25570 fn deser(
25571 _version: MavlinkVersion,
25572 __input: &[u8],
25573 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25574 let avail_len = __input.len();
25575 let mut payload_buf = [0; Self::ENCODED_LEN];
25576 let mut buf = if avail_len < Self::ENCODED_LEN {
25577 payload_buf[0..avail_len].copy_from_slice(__input);
25578 Bytes::new(&payload_buf)
25579 } else {
25580 Bytes::new(__input)
25581 };
25582 let mut __struct = Self::default();
25583 __struct.Vcc = buf.get_u16_le()?;
25584 __struct.Vservo = buf.get_u16_le()?;
25585 let tmp = buf.get_u16_le()?;
25586 __struct.flags = MavPowerStatus::from_bits(tmp as <MavPowerStatus as Flags>::Bits).ok_or(
25587 ::mavlink_core::error::ParserError::InvalidFlag {
25588 flag_type: "MavPowerStatus",
25589 value: tmp as u64,
25590 },
25591 )?;
25592 Ok(__struct)
25593 }
25594 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25595 let mut __tmp = BytesMut::new(bytes);
25596 #[allow(clippy::absurd_extreme_comparisons)]
25597 #[allow(unused_comparisons)]
25598 if __tmp.remaining() < Self::ENCODED_LEN {
25599 panic!(
25600 "buffer is too small (need {} bytes, but got {})",
25601 Self::ENCODED_LEN,
25602 __tmp.remaining(),
25603 )
25604 }
25605 __tmp.put_u16_le(self.Vcc);
25606 __tmp.put_u16_le(self.Vservo);
25607 __tmp.put_u16_le(self.flags.bits() as u16);
25608 if matches!(version, MavlinkVersion::V2) {
25609 let len = __tmp.len();
25610 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25611 } else {
25612 __tmp.len()
25613 }
25614 }
25615}
25616#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
25617#[doc = ""]
25618#[doc = "ID: 300"]
25619#[derive(Debug, Clone, PartialEq)]
25620#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25621#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25622#[cfg_attr(feature = "ts", derive(TS))]
25623#[cfg_attr(feature = "ts", ts(export))]
25624pub struct PROTOCOL_VERSION_DATA {
25625 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
25626 pub version: u16,
25627 #[doc = "Minimum MAVLink version supported"]
25628 pub min_version: u16,
25629 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
25630 pub max_version: u16,
25631 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
25632 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25633 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25634 pub spec_version_hash: [u8; 8],
25635 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
25636 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25637 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25638 pub library_version_hash: [u8; 8],
25639}
25640impl PROTOCOL_VERSION_DATA {
25641 pub const ENCODED_LEN: usize = 22usize;
25642 pub const DEFAULT: Self = Self {
25643 version: 0_u16,
25644 min_version: 0_u16,
25645 max_version: 0_u16,
25646 spec_version_hash: [0_u8; 8usize],
25647 library_version_hash: [0_u8; 8usize],
25648 };
25649 #[cfg(feature = "arbitrary")]
25650 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25651 use arbitrary::{Arbitrary, Unstructured};
25652 let mut buf = [0u8; 1024];
25653 rng.fill_bytes(&mut buf);
25654 let mut unstructured = Unstructured::new(&buf);
25655 Self::arbitrary(&mut unstructured).unwrap_or_default()
25656 }
25657}
25658impl Default for PROTOCOL_VERSION_DATA {
25659 fn default() -> Self {
25660 Self::DEFAULT.clone()
25661 }
25662}
25663impl MessageData for PROTOCOL_VERSION_DATA {
25664 type Message = MavMessage;
25665 const ID: u32 = 300u32;
25666 const NAME: &'static str = "PROTOCOL_VERSION";
25667 const EXTRA_CRC: u8 = 217u8;
25668 const ENCODED_LEN: usize = 22usize;
25669 fn deser(
25670 _version: MavlinkVersion,
25671 __input: &[u8],
25672 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25673 let avail_len = __input.len();
25674 let mut payload_buf = [0; Self::ENCODED_LEN];
25675 let mut buf = if avail_len < Self::ENCODED_LEN {
25676 payload_buf[0..avail_len].copy_from_slice(__input);
25677 Bytes::new(&payload_buf)
25678 } else {
25679 Bytes::new(__input)
25680 };
25681 let mut __struct = Self::default();
25682 __struct.version = buf.get_u16_le()?;
25683 __struct.min_version = buf.get_u16_le()?;
25684 __struct.max_version = buf.get_u16_le()?;
25685 for v in &mut __struct.spec_version_hash {
25686 let val = buf.get_u8()?;
25687 *v = val;
25688 }
25689 for v in &mut __struct.library_version_hash {
25690 let val = buf.get_u8()?;
25691 *v = val;
25692 }
25693 Ok(__struct)
25694 }
25695 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25696 let mut __tmp = BytesMut::new(bytes);
25697 #[allow(clippy::absurd_extreme_comparisons)]
25698 #[allow(unused_comparisons)]
25699 if __tmp.remaining() < Self::ENCODED_LEN {
25700 panic!(
25701 "buffer is too small (need {} bytes, but got {})",
25702 Self::ENCODED_LEN,
25703 __tmp.remaining(),
25704 )
25705 }
25706 __tmp.put_u16_le(self.version);
25707 __tmp.put_u16_le(self.min_version);
25708 __tmp.put_u16_le(self.max_version);
25709 for val in &self.spec_version_hash {
25710 __tmp.put_u8(*val);
25711 }
25712 for val in &self.library_version_hash {
25713 __tmp.put_u8(*val);
25714 }
25715 if matches!(version, MavlinkVersion::V2) {
25716 let len = __tmp.len();
25717 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25718 } else {
25719 __tmp.len()
25720 }
25721 }
25722}
25723#[doc = "Status generated by radio and injected into MAVLink stream."]
25724#[doc = ""]
25725#[doc = "ID: 109"]
25726#[derive(Debug, Clone, PartialEq)]
25727#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25728#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25729#[cfg_attr(feature = "ts", derive(TS))]
25730#[cfg_attr(feature = "ts", ts(export))]
25731pub struct RADIO_STATUS_DATA {
25732 #[doc = "Count of radio packet receive errors (since boot)."]
25733 pub rxerrors: u16,
25734 #[doc = "Count of error corrected radio packets (since boot)."]
25735 pub fixed: u16,
25736 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25737 pub rssi: u8,
25738 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25739 pub remrssi: u8,
25740 #[doc = "Remaining free transmitter buffer space."]
25741 pub txbuf: u8,
25742 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25743 pub noise: u8,
25744 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25745 pub remnoise: u8,
25746}
25747impl RADIO_STATUS_DATA {
25748 pub const ENCODED_LEN: usize = 9usize;
25749 pub const DEFAULT: Self = Self {
25750 rxerrors: 0_u16,
25751 fixed: 0_u16,
25752 rssi: 0_u8,
25753 remrssi: 0_u8,
25754 txbuf: 0_u8,
25755 noise: 0_u8,
25756 remnoise: 0_u8,
25757 };
25758 #[cfg(feature = "arbitrary")]
25759 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25760 use arbitrary::{Arbitrary, Unstructured};
25761 let mut buf = [0u8; 1024];
25762 rng.fill_bytes(&mut buf);
25763 let mut unstructured = Unstructured::new(&buf);
25764 Self::arbitrary(&mut unstructured).unwrap_or_default()
25765 }
25766}
25767impl Default for RADIO_STATUS_DATA {
25768 fn default() -> Self {
25769 Self::DEFAULT.clone()
25770 }
25771}
25772impl MessageData for RADIO_STATUS_DATA {
25773 type Message = MavMessage;
25774 const ID: u32 = 109u32;
25775 const NAME: &'static str = "RADIO_STATUS";
25776 const EXTRA_CRC: u8 = 185u8;
25777 const ENCODED_LEN: usize = 9usize;
25778 fn deser(
25779 _version: MavlinkVersion,
25780 __input: &[u8],
25781 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25782 let avail_len = __input.len();
25783 let mut payload_buf = [0; Self::ENCODED_LEN];
25784 let mut buf = if avail_len < Self::ENCODED_LEN {
25785 payload_buf[0..avail_len].copy_from_slice(__input);
25786 Bytes::new(&payload_buf)
25787 } else {
25788 Bytes::new(__input)
25789 };
25790 let mut __struct = Self::default();
25791 __struct.rxerrors = buf.get_u16_le()?;
25792 __struct.fixed = buf.get_u16_le()?;
25793 __struct.rssi = buf.get_u8()?;
25794 __struct.remrssi = buf.get_u8()?;
25795 __struct.txbuf = buf.get_u8()?;
25796 __struct.noise = buf.get_u8()?;
25797 __struct.remnoise = buf.get_u8()?;
25798 Ok(__struct)
25799 }
25800 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25801 let mut __tmp = BytesMut::new(bytes);
25802 #[allow(clippy::absurd_extreme_comparisons)]
25803 #[allow(unused_comparisons)]
25804 if __tmp.remaining() < Self::ENCODED_LEN {
25805 panic!(
25806 "buffer is too small (need {} bytes, but got {})",
25807 Self::ENCODED_LEN,
25808 __tmp.remaining(),
25809 )
25810 }
25811 __tmp.put_u16_le(self.rxerrors);
25812 __tmp.put_u16_le(self.fixed);
25813 __tmp.put_u8(self.rssi);
25814 __tmp.put_u8(self.remrssi);
25815 __tmp.put_u8(self.txbuf);
25816 __tmp.put_u8(self.noise);
25817 __tmp.put_u8(self.remnoise);
25818 if matches!(version, MavlinkVersion::V2) {
25819 let len = __tmp.len();
25820 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25821 } else {
25822 __tmp.len()
25823 }
25824 }
25825}
25826#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
25827#[doc = ""]
25828#[doc = "ID: 27"]
25829#[derive(Debug, Clone, PartialEq)]
25830#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25831#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25832#[cfg_attr(feature = "ts", derive(TS))]
25833#[cfg_attr(feature = "ts", ts(export))]
25834pub struct RAW_IMU_DATA {
25835 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25836 pub time_usec: u64,
25837 #[doc = "X acceleration (raw)"]
25838 pub xacc: i16,
25839 #[doc = "Y acceleration (raw)"]
25840 pub yacc: i16,
25841 #[doc = "Z acceleration (raw)"]
25842 pub zacc: i16,
25843 #[doc = "Angular speed around X axis (raw)"]
25844 pub xgyro: i16,
25845 #[doc = "Angular speed around Y axis (raw)"]
25846 pub ygyro: i16,
25847 #[doc = "Angular speed around Z axis (raw)"]
25848 pub zgyro: i16,
25849 #[doc = "X Magnetic field (raw)"]
25850 pub xmag: i16,
25851 #[doc = "Y Magnetic field (raw)"]
25852 pub ymag: i16,
25853 #[doc = "Z Magnetic field (raw)"]
25854 pub zmag: i16,
25855 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
25856 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25857 pub id: u8,
25858 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25859 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25860 pub temperature: i16,
25861}
25862impl RAW_IMU_DATA {
25863 pub const ENCODED_LEN: usize = 29usize;
25864 pub const DEFAULT: Self = Self {
25865 time_usec: 0_u64,
25866 xacc: 0_i16,
25867 yacc: 0_i16,
25868 zacc: 0_i16,
25869 xgyro: 0_i16,
25870 ygyro: 0_i16,
25871 zgyro: 0_i16,
25872 xmag: 0_i16,
25873 ymag: 0_i16,
25874 zmag: 0_i16,
25875 id: 0_u8,
25876 temperature: 0_i16,
25877 };
25878 #[cfg(feature = "arbitrary")]
25879 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25880 use arbitrary::{Arbitrary, Unstructured};
25881 let mut buf = [0u8; 1024];
25882 rng.fill_bytes(&mut buf);
25883 let mut unstructured = Unstructured::new(&buf);
25884 Self::arbitrary(&mut unstructured).unwrap_or_default()
25885 }
25886}
25887impl Default for RAW_IMU_DATA {
25888 fn default() -> Self {
25889 Self::DEFAULT.clone()
25890 }
25891}
25892impl MessageData for RAW_IMU_DATA {
25893 type Message = MavMessage;
25894 const ID: u32 = 27u32;
25895 const NAME: &'static str = "RAW_IMU";
25896 const EXTRA_CRC: u8 = 144u8;
25897 const ENCODED_LEN: usize = 29usize;
25898 fn deser(
25899 _version: MavlinkVersion,
25900 __input: &[u8],
25901 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25902 let avail_len = __input.len();
25903 let mut payload_buf = [0; Self::ENCODED_LEN];
25904 let mut buf = if avail_len < Self::ENCODED_LEN {
25905 payload_buf[0..avail_len].copy_from_slice(__input);
25906 Bytes::new(&payload_buf)
25907 } else {
25908 Bytes::new(__input)
25909 };
25910 let mut __struct = Self::default();
25911 __struct.time_usec = buf.get_u64_le()?;
25912 __struct.xacc = buf.get_i16_le()?;
25913 __struct.yacc = buf.get_i16_le()?;
25914 __struct.zacc = buf.get_i16_le()?;
25915 __struct.xgyro = buf.get_i16_le()?;
25916 __struct.ygyro = buf.get_i16_le()?;
25917 __struct.zgyro = buf.get_i16_le()?;
25918 __struct.xmag = buf.get_i16_le()?;
25919 __struct.ymag = buf.get_i16_le()?;
25920 __struct.zmag = buf.get_i16_le()?;
25921 __struct.id = buf.get_u8()?;
25922 __struct.temperature = buf.get_i16_le()?;
25923 Ok(__struct)
25924 }
25925 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25926 let mut __tmp = BytesMut::new(bytes);
25927 #[allow(clippy::absurd_extreme_comparisons)]
25928 #[allow(unused_comparisons)]
25929 if __tmp.remaining() < Self::ENCODED_LEN {
25930 panic!(
25931 "buffer is too small (need {} bytes, but got {})",
25932 Self::ENCODED_LEN,
25933 __tmp.remaining(),
25934 )
25935 }
25936 __tmp.put_u64_le(self.time_usec);
25937 __tmp.put_i16_le(self.xacc);
25938 __tmp.put_i16_le(self.yacc);
25939 __tmp.put_i16_le(self.zacc);
25940 __tmp.put_i16_le(self.xgyro);
25941 __tmp.put_i16_le(self.ygyro);
25942 __tmp.put_i16_le(self.zgyro);
25943 __tmp.put_i16_le(self.xmag);
25944 __tmp.put_i16_le(self.ymag);
25945 __tmp.put_i16_le(self.zmag);
25946 if matches!(version, MavlinkVersion::V2) {
25947 __tmp.put_u8(self.id);
25948 __tmp.put_i16_le(self.temperature);
25949 let len = __tmp.len();
25950 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25951 } else {
25952 __tmp.len()
25953 }
25954 }
25955}
25956#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
25957#[doc = ""]
25958#[doc = "ID: 28"]
25959#[derive(Debug, Clone, PartialEq)]
25960#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25961#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25962#[cfg_attr(feature = "ts", derive(TS))]
25963#[cfg_attr(feature = "ts", ts(export))]
25964pub struct RAW_PRESSURE_DATA {
25965 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25966 pub time_usec: u64,
25967 #[doc = "Absolute pressure (raw)"]
25968 pub press_abs: i16,
25969 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
25970 pub press_diff1: i16,
25971 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
25972 pub press_diff2: i16,
25973 #[doc = "Raw Temperature measurement (raw)"]
25974 pub temperature: i16,
25975}
25976impl RAW_PRESSURE_DATA {
25977 pub const ENCODED_LEN: usize = 16usize;
25978 pub const DEFAULT: Self = Self {
25979 time_usec: 0_u64,
25980 press_abs: 0_i16,
25981 press_diff1: 0_i16,
25982 press_diff2: 0_i16,
25983 temperature: 0_i16,
25984 };
25985 #[cfg(feature = "arbitrary")]
25986 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25987 use arbitrary::{Arbitrary, Unstructured};
25988 let mut buf = [0u8; 1024];
25989 rng.fill_bytes(&mut buf);
25990 let mut unstructured = Unstructured::new(&buf);
25991 Self::arbitrary(&mut unstructured).unwrap_or_default()
25992 }
25993}
25994impl Default for RAW_PRESSURE_DATA {
25995 fn default() -> Self {
25996 Self::DEFAULT.clone()
25997 }
25998}
25999impl MessageData for RAW_PRESSURE_DATA {
26000 type Message = MavMessage;
26001 const ID: u32 = 28u32;
26002 const NAME: &'static str = "RAW_PRESSURE";
26003 const EXTRA_CRC: u8 = 67u8;
26004 const ENCODED_LEN: usize = 16usize;
26005 fn deser(
26006 _version: MavlinkVersion,
26007 __input: &[u8],
26008 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26009 let avail_len = __input.len();
26010 let mut payload_buf = [0; Self::ENCODED_LEN];
26011 let mut buf = if avail_len < Self::ENCODED_LEN {
26012 payload_buf[0..avail_len].copy_from_slice(__input);
26013 Bytes::new(&payload_buf)
26014 } else {
26015 Bytes::new(__input)
26016 };
26017 let mut __struct = Self::default();
26018 __struct.time_usec = buf.get_u64_le()?;
26019 __struct.press_abs = buf.get_i16_le()?;
26020 __struct.press_diff1 = buf.get_i16_le()?;
26021 __struct.press_diff2 = buf.get_i16_le()?;
26022 __struct.temperature = buf.get_i16_le()?;
26023 Ok(__struct)
26024 }
26025 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26026 let mut __tmp = BytesMut::new(bytes);
26027 #[allow(clippy::absurd_extreme_comparisons)]
26028 #[allow(unused_comparisons)]
26029 if __tmp.remaining() < Self::ENCODED_LEN {
26030 panic!(
26031 "buffer is too small (need {} bytes, but got {})",
26032 Self::ENCODED_LEN,
26033 __tmp.remaining(),
26034 )
26035 }
26036 __tmp.put_u64_le(self.time_usec);
26037 __tmp.put_i16_le(self.press_abs);
26038 __tmp.put_i16_le(self.press_diff1);
26039 __tmp.put_i16_le(self.press_diff2);
26040 __tmp.put_i16_le(self.temperature);
26041 if matches!(version, MavlinkVersion::V2) {
26042 let len = __tmp.len();
26043 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26044 } else {
26045 __tmp.len()
26046 }
26047 }
26048}
26049#[doc = "RPM sensor data message."]
26050#[doc = ""]
26051#[doc = "ID: 339"]
26052#[derive(Debug, Clone, PartialEq)]
26053#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26054#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26055#[cfg_attr(feature = "ts", derive(TS))]
26056#[cfg_attr(feature = "ts", ts(export))]
26057pub struct RAW_RPM_DATA {
26058 #[doc = "Indicated rate"]
26059 pub frequency: f32,
26060 #[doc = "Index of this RPM sensor (0-indexed)"]
26061 pub index: u8,
26062}
26063impl RAW_RPM_DATA {
26064 pub const ENCODED_LEN: usize = 5usize;
26065 pub const DEFAULT: Self = Self {
26066 frequency: 0.0_f32,
26067 index: 0_u8,
26068 };
26069 #[cfg(feature = "arbitrary")]
26070 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26071 use arbitrary::{Arbitrary, Unstructured};
26072 let mut buf = [0u8; 1024];
26073 rng.fill_bytes(&mut buf);
26074 let mut unstructured = Unstructured::new(&buf);
26075 Self::arbitrary(&mut unstructured).unwrap_or_default()
26076 }
26077}
26078impl Default for RAW_RPM_DATA {
26079 fn default() -> Self {
26080 Self::DEFAULT.clone()
26081 }
26082}
26083impl MessageData for RAW_RPM_DATA {
26084 type Message = MavMessage;
26085 const ID: u32 = 339u32;
26086 const NAME: &'static str = "RAW_RPM";
26087 const EXTRA_CRC: u8 = 199u8;
26088 const ENCODED_LEN: usize = 5usize;
26089 fn deser(
26090 _version: MavlinkVersion,
26091 __input: &[u8],
26092 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26093 let avail_len = __input.len();
26094 let mut payload_buf = [0; Self::ENCODED_LEN];
26095 let mut buf = if avail_len < Self::ENCODED_LEN {
26096 payload_buf[0..avail_len].copy_from_slice(__input);
26097 Bytes::new(&payload_buf)
26098 } else {
26099 Bytes::new(__input)
26100 };
26101 let mut __struct = Self::default();
26102 __struct.frequency = buf.get_f32_le()?;
26103 __struct.index = buf.get_u8()?;
26104 Ok(__struct)
26105 }
26106 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26107 let mut __tmp = BytesMut::new(bytes);
26108 #[allow(clippy::absurd_extreme_comparisons)]
26109 #[allow(unused_comparisons)]
26110 if __tmp.remaining() < Self::ENCODED_LEN {
26111 panic!(
26112 "buffer is too small (need {} bytes, but got {})",
26113 Self::ENCODED_LEN,
26114 __tmp.remaining(),
26115 )
26116 }
26117 __tmp.put_f32_le(self.frequency);
26118 __tmp.put_u8(self.index);
26119 if matches!(version, MavlinkVersion::V2) {
26120 let len = __tmp.len();
26121 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26122 } else {
26123 __tmp.len()
26124 }
26125 }
26126}
26127#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
26128#[doc = ""]
26129#[doc = "ID: 65"]
26130#[derive(Debug, Clone, PartialEq)]
26131#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26133#[cfg_attr(feature = "ts", derive(TS))]
26134#[cfg_attr(feature = "ts", ts(export))]
26135pub struct RC_CHANNELS_DATA {
26136 #[doc = "Timestamp (time since system boot)."]
26137 pub time_boot_ms: u32,
26138 #[doc = "RC channel 1 value."]
26139 pub chan1_raw: u16,
26140 #[doc = "RC channel 2 value."]
26141 pub chan2_raw: u16,
26142 #[doc = "RC channel 3 value."]
26143 pub chan3_raw: u16,
26144 #[doc = "RC channel 4 value."]
26145 pub chan4_raw: u16,
26146 #[doc = "RC channel 5 value."]
26147 pub chan5_raw: u16,
26148 #[doc = "RC channel 6 value."]
26149 pub chan6_raw: u16,
26150 #[doc = "RC channel 7 value."]
26151 pub chan7_raw: u16,
26152 #[doc = "RC channel 8 value."]
26153 pub chan8_raw: u16,
26154 #[doc = "RC channel 9 value."]
26155 pub chan9_raw: u16,
26156 #[doc = "RC channel 10 value."]
26157 pub chan10_raw: u16,
26158 #[doc = "RC channel 11 value."]
26159 pub chan11_raw: u16,
26160 #[doc = "RC channel 12 value."]
26161 pub chan12_raw: u16,
26162 #[doc = "RC channel 13 value."]
26163 pub chan13_raw: u16,
26164 #[doc = "RC channel 14 value."]
26165 pub chan14_raw: u16,
26166 #[doc = "RC channel 15 value."]
26167 pub chan15_raw: u16,
26168 #[doc = "RC channel 16 value."]
26169 pub chan16_raw: u16,
26170 #[doc = "RC channel 17 value."]
26171 pub chan17_raw: u16,
26172 #[doc = "RC channel 18 value."]
26173 pub chan18_raw: u16,
26174 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
26175 pub chancount: u8,
26176 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26177 pub rssi: u8,
26178}
26179impl RC_CHANNELS_DATA {
26180 pub const ENCODED_LEN: usize = 42usize;
26181 pub const DEFAULT: Self = Self {
26182 time_boot_ms: 0_u32,
26183 chan1_raw: 0_u16,
26184 chan2_raw: 0_u16,
26185 chan3_raw: 0_u16,
26186 chan4_raw: 0_u16,
26187 chan5_raw: 0_u16,
26188 chan6_raw: 0_u16,
26189 chan7_raw: 0_u16,
26190 chan8_raw: 0_u16,
26191 chan9_raw: 0_u16,
26192 chan10_raw: 0_u16,
26193 chan11_raw: 0_u16,
26194 chan12_raw: 0_u16,
26195 chan13_raw: 0_u16,
26196 chan14_raw: 0_u16,
26197 chan15_raw: 0_u16,
26198 chan16_raw: 0_u16,
26199 chan17_raw: 0_u16,
26200 chan18_raw: 0_u16,
26201 chancount: 0_u8,
26202 rssi: 0_u8,
26203 };
26204 #[cfg(feature = "arbitrary")]
26205 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26206 use arbitrary::{Arbitrary, Unstructured};
26207 let mut buf = [0u8; 1024];
26208 rng.fill_bytes(&mut buf);
26209 let mut unstructured = Unstructured::new(&buf);
26210 Self::arbitrary(&mut unstructured).unwrap_or_default()
26211 }
26212}
26213impl Default for RC_CHANNELS_DATA {
26214 fn default() -> Self {
26215 Self::DEFAULT.clone()
26216 }
26217}
26218impl MessageData for RC_CHANNELS_DATA {
26219 type Message = MavMessage;
26220 const ID: u32 = 65u32;
26221 const NAME: &'static str = "RC_CHANNELS";
26222 const EXTRA_CRC: u8 = 118u8;
26223 const ENCODED_LEN: usize = 42usize;
26224 fn deser(
26225 _version: MavlinkVersion,
26226 __input: &[u8],
26227 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26228 let avail_len = __input.len();
26229 let mut payload_buf = [0; Self::ENCODED_LEN];
26230 let mut buf = if avail_len < Self::ENCODED_LEN {
26231 payload_buf[0..avail_len].copy_from_slice(__input);
26232 Bytes::new(&payload_buf)
26233 } else {
26234 Bytes::new(__input)
26235 };
26236 let mut __struct = Self::default();
26237 __struct.time_boot_ms = buf.get_u32_le()?;
26238 __struct.chan1_raw = buf.get_u16_le()?;
26239 __struct.chan2_raw = buf.get_u16_le()?;
26240 __struct.chan3_raw = buf.get_u16_le()?;
26241 __struct.chan4_raw = buf.get_u16_le()?;
26242 __struct.chan5_raw = buf.get_u16_le()?;
26243 __struct.chan6_raw = buf.get_u16_le()?;
26244 __struct.chan7_raw = buf.get_u16_le()?;
26245 __struct.chan8_raw = buf.get_u16_le()?;
26246 __struct.chan9_raw = buf.get_u16_le()?;
26247 __struct.chan10_raw = buf.get_u16_le()?;
26248 __struct.chan11_raw = buf.get_u16_le()?;
26249 __struct.chan12_raw = buf.get_u16_le()?;
26250 __struct.chan13_raw = buf.get_u16_le()?;
26251 __struct.chan14_raw = buf.get_u16_le()?;
26252 __struct.chan15_raw = buf.get_u16_le()?;
26253 __struct.chan16_raw = buf.get_u16_le()?;
26254 __struct.chan17_raw = buf.get_u16_le()?;
26255 __struct.chan18_raw = buf.get_u16_le()?;
26256 __struct.chancount = buf.get_u8()?;
26257 __struct.rssi = buf.get_u8()?;
26258 Ok(__struct)
26259 }
26260 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26261 let mut __tmp = BytesMut::new(bytes);
26262 #[allow(clippy::absurd_extreme_comparisons)]
26263 #[allow(unused_comparisons)]
26264 if __tmp.remaining() < Self::ENCODED_LEN {
26265 panic!(
26266 "buffer is too small (need {} bytes, but got {})",
26267 Self::ENCODED_LEN,
26268 __tmp.remaining(),
26269 )
26270 }
26271 __tmp.put_u32_le(self.time_boot_ms);
26272 __tmp.put_u16_le(self.chan1_raw);
26273 __tmp.put_u16_le(self.chan2_raw);
26274 __tmp.put_u16_le(self.chan3_raw);
26275 __tmp.put_u16_le(self.chan4_raw);
26276 __tmp.put_u16_le(self.chan5_raw);
26277 __tmp.put_u16_le(self.chan6_raw);
26278 __tmp.put_u16_le(self.chan7_raw);
26279 __tmp.put_u16_le(self.chan8_raw);
26280 __tmp.put_u16_le(self.chan9_raw);
26281 __tmp.put_u16_le(self.chan10_raw);
26282 __tmp.put_u16_le(self.chan11_raw);
26283 __tmp.put_u16_le(self.chan12_raw);
26284 __tmp.put_u16_le(self.chan13_raw);
26285 __tmp.put_u16_le(self.chan14_raw);
26286 __tmp.put_u16_le(self.chan15_raw);
26287 __tmp.put_u16_le(self.chan16_raw);
26288 __tmp.put_u16_le(self.chan17_raw);
26289 __tmp.put_u16_le(self.chan18_raw);
26290 __tmp.put_u8(self.chancount);
26291 __tmp.put_u8(self.rssi);
26292 if matches!(version, MavlinkVersion::V2) {
26293 let len = __tmp.len();
26294 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26295 } else {
26296 __tmp.len()
26297 }
26298 }
26299}
26300#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
26301#[doc = ""]
26302#[doc = "ID: 70"]
26303#[derive(Debug, Clone, PartialEq)]
26304#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26305#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26306#[cfg_attr(feature = "ts", derive(TS))]
26307#[cfg_attr(feature = "ts", ts(export))]
26308pub struct RC_CHANNELS_OVERRIDE_DATA {
26309 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26310 pub chan1_raw: u16,
26311 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26312 pub chan2_raw: u16,
26313 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26314 pub chan3_raw: u16,
26315 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26316 pub chan4_raw: u16,
26317 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26318 pub chan5_raw: u16,
26319 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26320 pub chan6_raw: u16,
26321 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26322 pub chan7_raw: u16,
26323 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26324 pub chan8_raw: u16,
26325 #[doc = "System ID"]
26326 pub target_system: u8,
26327 #[doc = "Component ID"]
26328 pub target_component: u8,
26329 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26330 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26331 pub chan9_raw: u16,
26332 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26333 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26334 pub chan10_raw: u16,
26335 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26336 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26337 pub chan11_raw: u16,
26338 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26339 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26340 pub chan12_raw: u16,
26341 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26342 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26343 pub chan13_raw: u16,
26344 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26345 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26346 pub chan14_raw: u16,
26347 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26348 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26349 pub chan15_raw: u16,
26350 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26351 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26352 pub chan16_raw: u16,
26353 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26354 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26355 pub chan17_raw: u16,
26356 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26357 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26358 pub chan18_raw: u16,
26359}
26360impl RC_CHANNELS_OVERRIDE_DATA {
26361 pub const ENCODED_LEN: usize = 38usize;
26362 pub const DEFAULT: Self = Self {
26363 chan1_raw: 0_u16,
26364 chan2_raw: 0_u16,
26365 chan3_raw: 0_u16,
26366 chan4_raw: 0_u16,
26367 chan5_raw: 0_u16,
26368 chan6_raw: 0_u16,
26369 chan7_raw: 0_u16,
26370 chan8_raw: 0_u16,
26371 target_system: 0_u8,
26372 target_component: 0_u8,
26373 chan9_raw: 0_u16,
26374 chan10_raw: 0_u16,
26375 chan11_raw: 0_u16,
26376 chan12_raw: 0_u16,
26377 chan13_raw: 0_u16,
26378 chan14_raw: 0_u16,
26379 chan15_raw: 0_u16,
26380 chan16_raw: 0_u16,
26381 chan17_raw: 0_u16,
26382 chan18_raw: 0_u16,
26383 };
26384 #[cfg(feature = "arbitrary")]
26385 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26386 use arbitrary::{Arbitrary, Unstructured};
26387 let mut buf = [0u8; 1024];
26388 rng.fill_bytes(&mut buf);
26389 let mut unstructured = Unstructured::new(&buf);
26390 Self::arbitrary(&mut unstructured).unwrap_or_default()
26391 }
26392}
26393impl Default for RC_CHANNELS_OVERRIDE_DATA {
26394 fn default() -> Self {
26395 Self::DEFAULT.clone()
26396 }
26397}
26398impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
26399 type Message = MavMessage;
26400 const ID: u32 = 70u32;
26401 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
26402 const EXTRA_CRC: u8 = 124u8;
26403 const ENCODED_LEN: usize = 38usize;
26404 fn deser(
26405 _version: MavlinkVersion,
26406 __input: &[u8],
26407 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26408 let avail_len = __input.len();
26409 let mut payload_buf = [0; Self::ENCODED_LEN];
26410 let mut buf = if avail_len < Self::ENCODED_LEN {
26411 payload_buf[0..avail_len].copy_from_slice(__input);
26412 Bytes::new(&payload_buf)
26413 } else {
26414 Bytes::new(__input)
26415 };
26416 let mut __struct = Self::default();
26417 __struct.chan1_raw = buf.get_u16_le()?;
26418 __struct.chan2_raw = buf.get_u16_le()?;
26419 __struct.chan3_raw = buf.get_u16_le()?;
26420 __struct.chan4_raw = buf.get_u16_le()?;
26421 __struct.chan5_raw = buf.get_u16_le()?;
26422 __struct.chan6_raw = buf.get_u16_le()?;
26423 __struct.chan7_raw = buf.get_u16_le()?;
26424 __struct.chan8_raw = buf.get_u16_le()?;
26425 __struct.target_system = buf.get_u8()?;
26426 __struct.target_component = buf.get_u8()?;
26427 __struct.chan9_raw = buf.get_u16_le()?;
26428 __struct.chan10_raw = buf.get_u16_le()?;
26429 __struct.chan11_raw = buf.get_u16_le()?;
26430 __struct.chan12_raw = buf.get_u16_le()?;
26431 __struct.chan13_raw = buf.get_u16_le()?;
26432 __struct.chan14_raw = buf.get_u16_le()?;
26433 __struct.chan15_raw = buf.get_u16_le()?;
26434 __struct.chan16_raw = buf.get_u16_le()?;
26435 __struct.chan17_raw = buf.get_u16_le()?;
26436 __struct.chan18_raw = buf.get_u16_le()?;
26437 Ok(__struct)
26438 }
26439 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26440 let mut __tmp = BytesMut::new(bytes);
26441 #[allow(clippy::absurd_extreme_comparisons)]
26442 #[allow(unused_comparisons)]
26443 if __tmp.remaining() < Self::ENCODED_LEN {
26444 panic!(
26445 "buffer is too small (need {} bytes, but got {})",
26446 Self::ENCODED_LEN,
26447 __tmp.remaining(),
26448 )
26449 }
26450 __tmp.put_u16_le(self.chan1_raw);
26451 __tmp.put_u16_le(self.chan2_raw);
26452 __tmp.put_u16_le(self.chan3_raw);
26453 __tmp.put_u16_le(self.chan4_raw);
26454 __tmp.put_u16_le(self.chan5_raw);
26455 __tmp.put_u16_le(self.chan6_raw);
26456 __tmp.put_u16_le(self.chan7_raw);
26457 __tmp.put_u16_le(self.chan8_raw);
26458 __tmp.put_u8(self.target_system);
26459 __tmp.put_u8(self.target_component);
26460 if matches!(version, MavlinkVersion::V2) {
26461 __tmp.put_u16_le(self.chan9_raw);
26462 __tmp.put_u16_le(self.chan10_raw);
26463 __tmp.put_u16_le(self.chan11_raw);
26464 __tmp.put_u16_le(self.chan12_raw);
26465 __tmp.put_u16_le(self.chan13_raw);
26466 __tmp.put_u16_le(self.chan14_raw);
26467 __tmp.put_u16_le(self.chan15_raw);
26468 __tmp.put_u16_le(self.chan16_raw);
26469 __tmp.put_u16_le(self.chan17_raw);
26470 __tmp.put_u16_le(self.chan18_raw);
26471 let len = __tmp.len();
26472 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26473 } else {
26474 __tmp.len()
26475 }
26476 }
26477}
26478#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
26479#[doc = ""]
26480#[doc = "ID: 35"]
26481#[derive(Debug, Clone, PartialEq)]
26482#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26483#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26484#[cfg_attr(feature = "ts", derive(TS))]
26485#[cfg_attr(feature = "ts", ts(export))]
26486pub struct RC_CHANNELS_RAW_DATA {
26487 #[doc = "Timestamp (time since system boot)."]
26488 pub time_boot_ms: u32,
26489 #[doc = "RC channel 1 value."]
26490 pub chan1_raw: u16,
26491 #[doc = "RC channel 2 value."]
26492 pub chan2_raw: u16,
26493 #[doc = "RC channel 3 value."]
26494 pub chan3_raw: u16,
26495 #[doc = "RC channel 4 value."]
26496 pub chan4_raw: u16,
26497 #[doc = "RC channel 5 value."]
26498 pub chan5_raw: u16,
26499 #[doc = "RC channel 6 value."]
26500 pub chan6_raw: u16,
26501 #[doc = "RC channel 7 value."]
26502 pub chan7_raw: u16,
26503 #[doc = "RC channel 8 value."]
26504 pub chan8_raw: u16,
26505 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26506 pub port: u8,
26507 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26508 pub rssi: u8,
26509}
26510impl RC_CHANNELS_RAW_DATA {
26511 pub const ENCODED_LEN: usize = 22usize;
26512 pub const DEFAULT: Self = Self {
26513 time_boot_ms: 0_u32,
26514 chan1_raw: 0_u16,
26515 chan2_raw: 0_u16,
26516 chan3_raw: 0_u16,
26517 chan4_raw: 0_u16,
26518 chan5_raw: 0_u16,
26519 chan6_raw: 0_u16,
26520 chan7_raw: 0_u16,
26521 chan8_raw: 0_u16,
26522 port: 0_u8,
26523 rssi: 0_u8,
26524 };
26525 #[cfg(feature = "arbitrary")]
26526 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26527 use arbitrary::{Arbitrary, Unstructured};
26528 let mut buf = [0u8; 1024];
26529 rng.fill_bytes(&mut buf);
26530 let mut unstructured = Unstructured::new(&buf);
26531 Self::arbitrary(&mut unstructured).unwrap_or_default()
26532 }
26533}
26534impl Default for RC_CHANNELS_RAW_DATA {
26535 fn default() -> Self {
26536 Self::DEFAULT.clone()
26537 }
26538}
26539impl MessageData for RC_CHANNELS_RAW_DATA {
26540 type Message = MavMessage;
26541 const ID: u32 = 35u32;
26542 const NAME: &'static str = "RC_CHANNELS_RAW";
26543 const EXTRA_CRC: u8 = 244u8;
26544 const ENCODED_LEN: usize = 22usize;
26545 fn deser(
26546 _version: MavlinkVersion,
26547 __input: &[u8],
26548 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26549 let avail_len = __input.len();
26550 let mut payload_buf = [0; Self::ENCODED_LEN];
26551 let mut buf = if avail_len < Self::ENCODED_LEN {
26552 payload_buf[0..avail_len].copy_from_slice(__input);
26553 Bytes::new(&payload_buf)
26554 } else {
26555 Bytes::new(__input)
26556 };
26557 let mut __struct = Self::default();
26558 __struct.time_boot_ms = buf.get_u32_le()?;
26559 __struct.chan1_raw = buf.get_u16_le()?;
26560 __struct.chan2_raw = buf.get_u16_le()?;
26561 __struct.chan3_raw = buf.get_u16_le()?;
26562 __struct.chan4_raw = buf.get_u16_le()?;
26563 __struct.chan5_raw = buf.get_u16_le()?;
26564 __struct.chan6_raw = buf.get_u16_le()?;
26565 __struct.chan7_raw = buf.get_u16_le()?;
26566 __struct.chan8_raw = buf.get_u16_le()?;
26567 __struct.port = buf.get_u8()?;
26568 __struct.rssi = buf.get_u8()?;
26569 Ok(__struct)
26570 }
26571 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26572 let mut __tmp = BytesMut::new(bytes);
26573 #[allow(clippy::absurd_extreme_comparisons)]
26574 #[allow(unused_comparisons)]
26575 if __tmp.remaining() < Self::ENCODED_LEN {
26576 panic!(
26577 "buffer is too small (need {} bytes, but got {})",
26578 Self::ENCODED_LEN,
26579 __tmp.remaining(),
26580 )
26581 }
26582 __tmp.put_u32_le(self.time_boot_ms);
26583 __tmp.put_u16_le(self.chan1_raw);
26584 __tmp.put_u16_le(self.chan2_raw);
26585 __tmp.put_u16_le(self.chan3_raw);
26586 __tmp.put_u16_le(self.chan4_raw);
26587 __tmp.put_u16_le(self.chan5_raw);
26588 __tmp.put_u16_le(self.chan6_raw);
26589 __tmp.put_u16_le(self.chan7_raw);
26590 __tmp.put_u16_le(self.chan8_raw);
26591 __tmp.put_u8(self.port);
26592 __tmp.put_u8(self.rssi);
26593 if matches!(version, MavlinkVersion::V2) {
26594 let len = __tmp.len();
26595 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26596 } else {
26597 __tmp.len()
26598 }
26599 }
26600}
26601#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
26602#[doc = ""]
26603#[doc = "ID: 34"]
26604#[derive(Debug, Clone, PartialEq)]
26605#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26606#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26607#[cfg_attr(feature = "ts", derive(TS))]
26608#[cfg_attr(feature = "ts", ts(export))]
26609pub struct RC_CHANNELS_SCALED_DATA {
26610 #[doc = "Timestamp (time since system boot)."]
26611 pub time_boot_ms: u32,
26612 #[doc = "RC channel 1 value scaled."]
26613 pub chan1_scaled: i16,
26614 #[doc = "RC channel 2 value scaled."]
26615 pub chan2_scaled: i16,
26616 #[doc = "RC channel 3 value scaled."]
26617 pub chan3_scaled: i16,
26618 #[doc = "RC channel 4 value scaled."]
26619 pub chan4_scaled: i16,
26620 #[doc = "RC channel 5 value scaled."]
26621 pub chan5_scaled: i16,
26622 #[doc = "RC channel 6 value scaled."]
26623 pub chan6_scaled: i16,
26624 #[doc = "RC channel 7 value scaled."]
26625 pub chan7_scaled: i16,
26626 #[doc = "RC channel 8 value scaled."]
26627 pub chan8_scaled: i16,
26628 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26629 pub port: u8,
26630 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26631 pub rssi: u8,
26632}
26633impl RC_CHANNELS_SCALED_DATA {
26634 pub const ENCODED_LEN: usize = 22usize;
26635 pub const DEFAULT: Self = Self {
26636 time_boot_ms: 0_u32,
26637 chan1_scaled: 0_i16,
26638 chan2_scaled: 0_i16,
26639 chan3_scaled: 0_i16,
26640 chan4_scaled: 0_i16,
26641 chan5_scaled: 0_i16,
26642 chan6_scaled: 0_i16,
26643 chan7_scaled: 0_i16,
26644 chan8_scaled: 0_i16,
26645 port: 0_u8,
26646 rssi: 0_u8,
26647 };
26648 #[cfg(feature = "arbitrary")]
26649 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26650 use arbitrary::{Arbitrary, Unstructured};
26651 let mut buf = [0u8; 1024];
26652 rng.fill_bytes(&mut buf);
26653 let mut unstructured = Unstructured::new(&buf);
26654 Self::arbitrary(&mut unstructured).unwrap_or_default()
26655 }
26656}
26657impl Default for RC_CHANNELS_SCALED_DATA {
26658 fn default() -> Self {
26659 Self::DEFAULT.clone()
26660 }
26661}
26662impl MessageData for RC_CHANNELS_SCALED_DATA {
26663 type Message = MavMessage;
26664 const ID: u32 = 34u32;
26665 const NAME: &'static str = "RC_CHANNELS_SCALED";
26666 const EXTRA_CRC: u8 = 237u8;
26667 const ENCODED_LEN: usize = 22usize;
26668 fn deser(
26669 _version: MavlinkVersion,
26670 __input: &[u8],
26671 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26672 let avail_len = __input.len();
26673 let mut payload_buf = [0; Self::ENCODED_LEN];
26674 let mut buf = if avail_len < Self::ENCODED_LEN {
26675 payload_buf[0..avail_len].copy_from_slice(__input);
26676 Bytes::new(&payload_buf)
26677 } else {
26678 Bytes::new(__input)
26679 };
26680 let mut __struct = Self::default();
26681 __struct.time_boot_ms = buf.get_u32_le()?;
26682 __struct.chan1_scaled = buf.get_i16_le()?;
26683 __struct.chan2_scaled = buf.get_i16_le()?;
26684 __struct.chan3_scaled = buf.get_i16_le()?;
26685 __struct.chan4_scaled = buf.get_i16_le()?;
26686 __struct.chan5_scaled = buf.get_i16_le()?;
26687 __struct.chan6_scaled = buf.get_i16_le()?;
26688 __struct.chan7_scaled = buf.get_i16_le()?;
26689 __struct.chan8_scaled = buf.get_i16_le()?;
26690 __struct.port = buf.get_u8()?;
26691 __struct.rssi = buf.get_u8()?;
26692 Ok(__struct)
26693 }
26694 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26695 let mut __tmp = BytesMut::new(bytes);
26696 #[allow(clippy::absurd_extreme_comparisons)]
26697 #[allow(unused_comparisons)]
26698 if __tmp.remaining() < Self::ENCODED_LEN {
26699 panic!(
26700 "buffer is too small (need {} bytes, but got {})",
26701 Self::ENCODED_LEN,
26702 __tmp.remaining(),
26703 )
26704 }
26705 __tmp.put_u32_le(self.time_boot_ms);
26706 __tmp.put_i16_le(self.chan1_scaled);
26707 __tmp.put_i16_le(self.chan2_scaled);
26708 __tmp.put_i16_le(self.chan3_scaled);
26709 __tmp.put_i16_le(self.chan4_scaled);
26710 __tmp.put_i16_le(self.chan5_scaled);
26711 __tmp.put_i16_le(self.chan6_scaled);
26712 __tmp.put_i16_le(self.chan7_scaled);
26713 __tmp.put_i16_le(self.chan8_scaled);
26714 __tmp.put_u8(self.port);
26715 __tmp.put_u8(self.rssi);
26716 if matches!(version, MavlinkVersion::V2) {
26717 let len = __tmp.len();
26718 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26719 } else {
26720 __tmp.len()
26721 }
26722 }
26723}
26724#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
26725#[doc = "Request a data stream."]
26726#[doc = ""]
26727#[doc = "ID: 66"]
26728#[derive(Debug, Clone, PartialEq)]
26729#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26730#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26731#[cfg_attr(feature = "ts", derive(TS))]
26732#[cfg_attr(feature = "ts", ts(export))]
26733pub struct REQUEST_DATA_STREAM_DATA {
26734 #[doc = "The requested message rate"]
26735 pub req_message_rate: u16,
26736 #[doc = "The target requested to send the message stream."]
26737 pub target_system: u8,
26738 #[doc = "The target requested to send the message stream."]
26739 pub target_component: u8,
26740 #[doc = "The ID of the requested data stream"]
26741 pub req_stream_id: u8,
26742 #[doc = "1 to start sending, 0 to stop sending."]
26743 pub start_stop: u8,
26744}
26745impl REQUEST_DATA_STREAM_DATA {
26746 pub const ENCODED_LEN: usize = 6usize;
26747 pub const DEFAULT: Self = Self {
26748 req_message_rate: 0_u16,
26749 target_system: 0_u8,
26750 target_component: 0_u8,
26751 req_stream_id: 0_u8,
26752 start_stop: 0_u8,
26753 };
26754 #[cfg(feature = "arbitrary")]
26755 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26756 use arbitrary::{Arbitrary, Unstructured};
26757 let mut buf = [0u8; 1024];
26758 rng.fill_bytes(&mut buf);
26759 let mut unstructured = Unstructured::new(&buf);
26760 Self::arbitrary(&mut unstructured).unwrap_or_default()
26761 }
26762}
26763impl Default for REQUEST_DATA_STREAM_DATA {
26764 fn default() -> Self {
26765 Self::DEFAULT.clone()
26766 }
26767}
26768impl MessageData for REQUEST_DATA_STREAM_DATA {
26769 type Message = MavMessage;
26770 const ID: u32 = 66u32;
26771 const NAME: &'static str = "REQUEST_DATA_STREAM";
26772 const EXTRA_CRC: u8 = 148u8;
26773 const ENCODED_LEN: usize = 6usize;
26774 fn deser(
26775 _version: MavlinkVersion,
26776 __input: &[u8],
26777 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26778 let avail_len = __input.len();
26779 let mut payload_buf = [0; Self::ENCODED_LEN];
26780 let mut buf = if avail_len < Self::ENCODED_LEN {
26781 payload_buf[0..avail_len].copy_from_slice(__input);
26782 Bytes::new(&payload_buf)
26783 } else {
26784 Bytes::new(__input)
26785 };
26786 let mut __struct = Self::default();
26787 __struct.req_message_rate = buf.get_u16_le()?;
26788 __struct.target_system = buf.get_u8()?;
26789 __struct.target_component = buf.get_u8()?;
26790 __struct.req_stream_id = buf.get_u8()?;
26791 __struct.start_stop = buf.get_u8()?;
26792 Ok(__struct)
26793 }
26794 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26795 let mut __tmp = BytesMut::new(bytes);
26796 #[allow(clippy::absurd_extreme_comparisons)]
26797 #[allow(unused_comparisons)]
26798 if __tmp.remaining() < Self::ENCODED_LEN {
26799 panic!(
26800 "buffer is too small (need {} bytes, but got {})",
26801 Self::ENCODED_LEN,
26802 __tmp.remaining(),
26803 )
26804 }
26805 __tmp.put_u16_le(self.req_message_rate);
26806 __tmp.put_u8(self.target_system);
26807 __tmp.put_u8(self.target_component);
26808 __tmp.put_u8(self.req_stream_id);
26809 __tmp.put_u8(self.start_stop);
26810 if matches!(version, MavlinkVersion::V2) {
26811 let len = __tmp.len();
26812 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26813 } else {
26814 __tmp.len()
26815 }
26816 }
26817}
26818#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
26819#[doc = ""]
26820#[doc = "ID: 412"]
26821#[derive(Debug, Clone, PartialEq)]
26822#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26823#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26824#[cfg_attr(feature = "ts", derive(TS))]
26825#[cfg_attr(feature = "ts", ts(export))]
26826pub struct REQUEST_EVENT_DATA {
26827 #[doc = "First sequence number of the requested event."]
26828 pub first_sequence: u16,
26829 #[doc = "Last sequence number of the requested event."]
26830 pub last_sequence: u16,
26831 #[doc = "System ID"]
26832 pub target_system: u8,
26833 #[doc = "Component ID"]
26834 pub target_component: u8,
26835}
26836impl REQUEST_EVENT_DATA {
26837 pub const ENCODED_LEN: usize = 6usize;
26838 pub const DEFAULT: Self = Self {
26839 first_sequence: 0_u16,
26840 last_sequence: 0_u16,
26841 target_system: 0_u8,
26842 target_component: 0_u8,
26843 };
26844 #[cfg(feature = "arbitrary")]
26845 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26846 use arbitrary::{Arbitrary, Unstructured};
26847 let mut buf = [0u8; 1024];
26848 rng.fill_bytes(&mut buf);
26849 let mut unstructured = Unstructured::new(&buf);
26850 Self::arbitrary(&mut unstructured).unwrap_or_default()
26851 }
26852}
26853impl Default for REQUEST_EVENT_DATA {
26854 fn default() -> Self {
26855 Self::DEFAULT.clone()
26856 }
26857}
26858impl MessageData for REQUEST_EVENT_DATA {
26859 type Message = MavMessage;
26860 const ID: u32 = 412u32;
26861 const NAME: &'static str = "REQUEST_EVENT";
26862 const EXTRA_CRC: u8 = 33u8;
26863 const ENCODED_LEN: usize = 6usize;
26864 fn deser(
26865 _version: MavlinkVersion,
26866 __input: &[u8],
26867 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26868 let avail_len = __input.len();
26869 let mut payload_buf = [0; Self::ENCODED_LEN];
26870 let mut buf = if avail_len < Self::ENCODED_LEN {
26871 payload_buf[0..avail_len].copy_from_slice(__input);
26872 Bytes::new(&payload_buf)
26873 } else {
26874 Bytes::new(__input)
26875 };
26876 let mut __struct = Self::default();
26877 __struct.first_sequence = buf.get_u16_le()?;
26878 __struct.last_sequence = buf.get_u16_le()?;
26879 __struct.target_system = buf.get_u8()?;
26880 __struct.target_component = buf.get_u8()?;
26881 Ok(__struct)
26882 }
26883 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26884 let mut __tmp = BytesMut::new(bytes);
26885 #[allow(clippy::absurd_extreme_comparisons)]
26886 #[allow(unused_comparisons)]
26887 if __tmp.remaining() < Self::ENCODED_LEN {
26888 panic!(
26889 "buffer is too small (need {} bytes, but got {})",
26890 Self::ENCODED_LEN,
26891 __tmp.remaining(),
26892 )
26893 }
26894 __tmp.put_u16_le(self.first_sequence);
26895 __tmp.put_u16_le(self.last_sequence);
26896 __tmp.put_u8(self.target_system);
26897 __tmp.put_u8(self.target_component);
26898 if matches!(version, MavlinkVersion::V2) {
26899 let len = __tmp.len();
26900 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26901 } else {
26902 __tmp.len()
26903 }
26904 }
26905}
26906#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
26907#[doc = ""]
26908#[doc = "ID: 142"]
26909#[derive(Debug, Clone, PartialEq)]
26910#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26911#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26912#[cfg_attr(feature = "ts", derive(TS))]
26913#[cfg_attr(feature = "ts", ts(export))]
26914pub struct RESOURCE_REQUEST_DATA {
26915 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
26916 pub request_id: u8,
26917 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
26918 pub uri_type: u8,
26919 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
26920 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26921 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
26922 pub uri: [u8; 120],
26923 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
26924 pub transfer_type: u8,
26925 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
26926 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26927 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
26928 pub storage: [u8; 120],
26929}
26930impl RESOURCE_REQUEST_DATA {
26931 pub const ENCODED_LEN: usize = 243usize;
26932 pub const DEFAULT: Self = Self {
26933 request_id: 0_u8,
26934 uri_type: 0_u8,
26935 uri: [0_u8; 120usize],
26936 transfer_type: 0_u8,
26937 storage: [0_u8; 120usize],
26938 };
26939 #[cfg(feature = "arbitrary")]
26940 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26941 use arbitrary::{Arbitrary, Unstructured};
26942 let mut buf = [0u8; 1024];
26943 rng.fill_bytes(&mut buf);
26944 let mut unstructured = Unstructured::new(&buf);
26945 Self::arbitrary(&mut unstructured).unwrap_or_default()
26946 }
26947}
26948impl Default for RESOURCE_REQUEST_DATA {
26949 fn default() -> Self {
26950 Self::DEFAULT.clone()
26951 }
26952}
26953impl MessageData for RESOURCE_REQUEST_DATA {
26954 type Message = MavMessage;
26955 const ID: u32 = 142u32;
26956 const NAME: &'static str = "RESOURCE_REQUEST";
26957 const EXTRA_CRC: u8 = 72u8;
26958 const ENCODED_LEN: usize = 243usize;
26959 fn deser(
26960 _version: MavlinkVersion,
26961 __input: &[u8],
26962 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26963 let avail_len = __input.len();
26964 let mut payload_buf = [0; Self::ENCODED_LEN];
26965 let mut buf = if avail_len < Self::ENCODED_LEN {
26966 payload_buf[0..avail_len].copy_from_slice(__input);
26967 Bytes::new(&payload_buf)
26968 } else {
26969 Bytes::new(__input)
26970 };
26971 let mut __struct = Self::default();
26972 __struct.request_id = buf.get_u8()?;
26973 __struct.uri_type = buf.get_u8()?;
26974 for v in &mut __struct.uri {
26975 let val = buf.get_u8()?;
26976 *v = val;
26977 }
26978 __struct.transfer_type = buf.get_u8()?;
26979 for v in &mut __struct.storage {
26980 let val = buf.get_u8()?;
26981 *v = val;
26982 }
26983 Ok(__struct)
26984 }
26985 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26986 let mut __tmp = BytesMut::new(bytes);
26987 #[allow(clippy::absurd_extreme_comparisons)]
26988 #[allow(unused_comparisons)]
26989 if __tmp.remaining() < Self::ENCODED_LEN {
26990 panic!(
26991 "buffer is too small (need {} bytes, but got {})",
26992 Self::ENCODED_LEN,
26993 __tmp.remaining(),
26994 )
26995 }
26996 __tmp.put_u8(self.request_id);
26997 __tmp.put_u8(self.uri_type);
26998 for val in &self.uri {
26999 __tmp.put_u8(*val);
27000 }
27001 __tmp.put_u8(self.transfer_type);
27002 for val in &self.storage {
27003 __tmp.put_u8(*val);
27004 }
27005 if matches!(version, MavlinkVersion::V2) {
27006 let len = __tmp.len();
27007 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27008 } else {
27009 __tmp.len()
27010 }
27011 }
27012}
27013#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
27014#[doc = ""]
27015#[doc = "ID: 413"]
27016#[derive(Debug, Clone, PartialEq)]
27017#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27018#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27019#[cfg_attr(feature = "ts", derive(TS))]
27020#[cfg_attr(feature = "ts", ts(export))]
27021pub struct RESPONSE_EVENT_ERROR_DATA {
27022 #[doc = "Sequence number."]
27023 pub sequence: u16,
27024 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
27025 pub sequence_oldest_available: u16,
27026 #[doc = "System ID"]
27027 pub target_system: u8,
27028 #[doc = "Component ID"]
27029 pub target_component: u8,
27030 #[doc = "Error reason."]
27031 pub reason: MavEventErrorReason,
27032}
27033impl RESPONSE_EVENT_ERROR_DATA {
27034 pub const ENCODED_LEN: usize = 7usize;
27035 pub const DEFAULT: Self = Self {
27036 sequence: 0_u16,
27037 sequence_oldest_available: 0_u16,
27038 target_system: 0_u8,
27039 target_component: 0_u8,
27040 reason: MavEventErrorReason::DEFAULT,
27041 };
27042 #[cfg(feature = "arbitrary")]
27043 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27044 use arbitrary::{Arbitrary, Unstructured};
27045 let mut buf = [0u8; 1024];
27046 rng.fill_bytes(&mut buf);
27047 let mut unstructured = Unstructured::new(&buf);
27048 Self::arbitrary(&mut unstructured).unwrap_or_default()
27049 }
27050}
27051impl Default for RESPONSE_EVENT_ERROR_DATA {
27052 fn default() -> Self {
27053 Self::DEFAULT.clone()
27054 }
27055}
27056impl MessageData for RESPONSE_EVENT_ERROR_DATA {
27057 type Message = MavMessage;
27058 const ID: u32 = 413u32;
27059 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
27060 const EXTRA_CRC: u8 = 77u8;
27061 const ENCODED_LEN: usize = 7usize;
27062 fn deser(
27063 _version: MavlinkVersion,
27064 __input: &[u8],
27065 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27066 let avail_len = __input.len();
27067 let mut payload_buf = [0; Self::ENCODED_LEN];
27068 let mut buf = if avail_len < Self::ENCODED_LEN {
27069 payload_buf[0..avail_len].copy_from_slice(__input);
27070 Bytes::new(&payload_buf)
27071 } else {
27072 Bytes::new(__input)
27073 };
27074 let mut __struct = Self::default();
27075 __struct.sequence = buf.get_u16_le()?;
27076 __struct.sequence_oldest_available = buf.get_u16_le()?;
27077 __struct.target_system = buf.get_u8()?;
27078 __struct.target_component = buf.get_u8()?;
27079 let tmp = buf.get_u8()?;
27080 __struct.reason =
27081 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27082 enum_type: "MavEventErrorReason",
27083 value: tmp as u64,
27084 })?;
27085 Ok(__struct)
27086 }
27087 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27088 let mut __tmp = BytesMut::new(bytes);
27089 #[allow(clippy::absurd_extreme_comparisons)]
27090 #[allow(unused_comparisons)]
27091 if __tmp.remaining() < Self::ENCODED_LEN {
27092 panic!(
27093 "buffer is too small (need {} bytes, but got {})",
27094 Self::ENCODED_LEN,
27095 __tmp.remaining(),
27096 )
27097 }
27098 __tmp.put_u16_le(self.sequence);
27099 __tmp.put_u16_le(self.sequence_oldest_available);
27100 __tmp.put_u8(self.target_system);
27101 __tmp.put_u8(self.target_component);
27102 __tmp.put_u8(self.reason as u8);
27103 if matches!(version, MavlinkVersion::V2) {
27104 let len = __tmp.len();
27105 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27106 } else {
27107 __tmp.len()
27108 }
27109 }
27110}
27111#[doc = "Read out the safety zone the MAV currently assumes."]
27112#[doc = ""]
27113#[doc = "ID: 55"]
27114#[derive(Debug, Clone, PartialEq)]
27115#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27116#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27117#[cfg_attr(feature = "ts", derive(TS))]
27118#[cfg_attr(feature = "ts", ts(export))]
27119pub struct SAFETY_ALLOWED_AREA_DATA {
27120 #[doc = "x position 1 / Latitude 1"]
27121 pub p1x: f32,
27122 #[doc = "y position 1 / Longitude 1"]
27123 pub p1y: f32,
27124 #[doc = "z position 1 / Altitude 1"]
27125 pub p1z: f32,
27126 #[doc = "x position 2 / Latitude 2"]
27127 pub p2x: f32,
27128 #[doc = "y position 2 / Longitude 2"]
27129 pub p2y: f32,
27130 #[doc = "z position 2 / Altitude 2"]
27131 pub p2z: f32,
27132 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
27133 pub frame: MavFrame,
27134}
27135impl SAFETY_ALLOWED_AREA_DATA {
27136 pub const ENCODED_LEN: usize = 25usize;
27137 pub const DEFAULT: Self = Self {
27138 p1x: 0.0_f32,
27139 p1y: 0.0_f32,
27140 p1z: 0.0_f32,
27141 p2x: 0.0_f32,
27142 p2y: 0.0_f32,
27143 p2z: 0.0_f32,
27144 frame: MavFrame::DEFAULT,
27145 };
27146 #[cfg(feature = "arbitrary")]
27147 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27148 use arbitrary::{Arbitrary, Unstructured};
27149 let mut buf = [0u8; 1024];
27150 rng.fill_bytes(&mut buf);
27151 let mut unstructured = Unstructured::new(&buf);
27152 Self::arbitrary(&mut unstructured).unwrap_or_default()
27153 }
27154}
27155impl Default for SAFETY_ALLOWED_AREA_DATA {
27156 fn default() -> Self {
27157 Self::DEFAULT.clone()
27158 }
27159}
27160impl MessageData for SAFETY_ALLOWED_AREA_DATA {
27161 type Message = MavMessage;
27162 const ID: u32 = 55u32;
27163 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
27164 const EXTRA_CRC: u8 = 3u8;
27165 const ENCODED_LEN: usize = 25usize;
27166 fn deser(
27167 _version: MavlinkVersion,
27168 __input: &[u8],
27169 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27170 let avail_len = __input.len();
27171 let mut payload_buf = [0; Self::ENCODED_LEN];
27172 let mut buf = if avail_len < Self::ENCODED_LEN {
27173 payload_buf[0..avail_len].copy_from_slice(__input);
27174 Bytes::new(&payload_buf)
27175 } else {
27176 Bytes::new(__input)
27177 };
27178 let mut __struct = Self::default();
27179 __struct.p1x = buf.get_f32_le()?;
27180 __struct.p1y = buf.get_f32_le()?;
27181 __struct.p1z = buf.get_f32_le()?;
27182 __struct.p2x = buf.get_f32_le()?;
27183 __struct.p2y = buf.get_f32_le()?;
27184 __struct.p2z = buf.get_f32_le()?;
27185 let tmp = buf.get_u8()?;
27186 __struct.frame =
27187 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27188 enum_type: "MavFrame",
27189 value: tmp as u64,
27190 })?;
27191 Ok(__struct)
27192 }
27193 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27194 let mut __tmp = BytesMut::new(bytes);
27195 #[allow(clippy::absurd_extreme_comparisons)]
27196 #[allow(unused_comparisons)]
27197 if __tmp.remaining() < Self::ENCODED_LEN {
27198 panic!(
27199 "buffer is too small (need {} bytes, but got {})",
27200 Self::ENCODED_LEN,
27201 __tmp.remaining(),
27202 )
27203 }
27204 __tmp.put_f32_le(self.p1x);
27205 __tmp.put_f32_le(self.p1y);
27206 __tmp.put_f32_le(self.p1z);
27207 __tmp.put_f32_le(self.p2x);
27208 __tmp.put_f32_le(self.p2y);
27209 __tmp.put_f32_le(self.p2z);
27210 __tmp.put_u8(self.frame as u8);
27211 if matches!(version, MavlinkVersion::V2) {
27212 let len = __tmp.len();
27213 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27214 } else {
27215 __tmp.len()
27216 }
27217 }
27218}
27219#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
27220#[doc = ""]
27221#[doc = "ID: 54"]
27222#[derive(Debug, Clone, PartialEq)]
27223#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27224#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27225#[cfg_attr(feature = "ts", derive(TS))]
27226#[cfg_attr(feature = "ts", ts(export))]
27227pub struct SAFETY_SET_ALLOWED_AREA_DATA {
27228 #[doc = "x position 1 / Latitude 1"]
27229 pub p1x: f32,
27230 #[doc = "y position 1 / Longitude 1"]
27231 pub p1y: f32,
27232 #[doc = "z position 1 / Altitude 1"]
27233 pub p1z: f32,
27234 #[doc = "x position 2 / Latitude 2"]
27235 pub p2x: f32,
27236 #[doc = "y position 2 / Longitude 2"]
27237 pub p2y: f32,
27238 #[doc = "z position 2 / Altitude 2"]
27239 pub p2z: f32,
27240 #[doc = "System ID"]
27241 pub target_system: u8,
27242 #[doc = "Component ID"]
27243 pub target_component: u8,
27244 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
27245 pub frame: MavFrame,
27246}
27247impl SAFETY_SET_ALLOWED_AREA_DATA {
27248 pub const ENCODED_LEN: usize = 27usize;
27249 pub const DEFAULT: Self = Self {
27250 p1x: 0.0_f32,
27251 p1y: 0.0_f32,
27252 p1z: 0.0_f32,
27253 p2x: 0.0_f32,
27254 p2y: 0.0_f32,
27255 p2z: 0.0_f32,
27256 target_system: 0_u8,
27257 target_component: 0_u8,
27258 frame: MavFrame::DEFAULT,
27259 };
27260 #[cfg(feature = "arbitrary")]
27261 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27262 use arbitrary::{Arbitrary, Unstructured};
27263 let mut buf = [0u8; 1024];
27264 rng.fill_bytes(&mut buf);
27265 let mut unstructured = Unstructured::new(&buf);
27266 Self::arbitrary(&mut unstructured).unwrap_or_default()
27267 }
27268}
27269impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
27270 fn default() -> Self {
27271 Self::DEFAULT.clone()
27272 }
27273}
27274impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
27275 type Message = MavMessage;
27276 const ID: u32 = 54u32;
27277 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
27278 const EXTRA_CRC: u8 = 15u8;
27279 const ENCODED_LEN: usize = 27usize;
27280 fn deser(
27281 _version: MavlinkVersion,
27282 __input: &[u8],
27283 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27284 let avail_len = __input.len();
27285 let mut payload_buf = [0; Self::ENCODED_LEN];
27286 let mut buf = if avail_len < Self::ENCODED_LEN {
27287 payload_buf[0..avail_len].copy_from_slice(__input);
27288 Bytes::new(&payload_buf)
27289 } else {
27290 Bytes::new(__input)
27291 };
27292 let mut __struct = Self::default();
27293 __struct.p1x = buf.get_f32_le()?;
27294 __struct.p1y = buf.get_f32_le()?;
27295 __struct.p1z = buf.get_f32_le()?;
27296 __struct.p2x = buf.get_f32_le()?;
27297 __struct.p2y = buf.get_f32_le()?;
27298 __struct.p2z = buf.get_f32_le()?;
27299 __struct.target_system = buf.get_u8()?;
27300 __struct.target_component = buf.get_u8()?;
27301 let tmp = buf.get_u8()?;
27302 __struct.frame =
27303 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27304 enum_type: "MavFrame",
27305 value: tmp as u64,
27306 })?;
27307 Ok(__struct)
27308 }
27309 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27310 let mut __tmp = BytesMut::new(bytes);
27311 #[allow(clippy::absurd_extreme_comparisons)]
27312 #[allow(unused_comparisons)]
27313 if __tmp.remaining() < Self::ENCODED_LEN {
27314 panic!(
27315 "buffer is too small (need {} bytes, but got {})",
27316 Self::ENCODED_LEN,
27317 __tmp.remaining(),
27318 )
27319 }
27320 __tmp.put_f32_le(self.p1x);
27321 __tmp.put_f32_le(self.p1y);
27322 __tmp.put_f32_le(self.p1z);
27323 __tmp.put_f32_le(self.p2x);
27324 __tmp.put_f32_le(self.p2y);
27325 __tmp.put_f32_le(self.p2z);
27326 __tmp.put_u8(self.target_system);
27327 __tmp.put_u8(self.target_component);
27328 __tmp.put_u8(self.frame as u8);
27329 if matches!(version, MavlinkVersion::V2) {
27330 let len = __tmp.len();
27331 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27332 } else {
27333 __tmp.len()
27334 }
27335 }
27336}
27337#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
27338#[doc = ""]
27339#[doc = "ID: 26"]
27340#[derive(Debug, Clone, PartialEq)]
27341#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27342#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27343#[cfg_attr(feature = "ts", derive(TS))]
27344#[cfg_attr(feature = "ts", ts(export))]
27345pub struct SCALED_IMU_DATA {
27346 #[doc = "Timestamp (time since system boot)."]
27347 pub time_boot_ms: u32,
27348 #[doc = "X acceleration"]
27349 pub xacc: i16,
27350 #[doc = "Y acceleration"]
27351 pub yacc: i16,
27352 #[doc = "Z acceleration"]
27353 pub zacc: i16,
27354 #[doc = "Angular speed around X axis"]
27355 pub xgyro: i16,
27356 #[doc = "Angular speed around Y axis"]
27357 pub ygyro: i16,
27358 #[doc = "Angular speed around Z axis"]
27359 pub zgyro: i16,
27360 #[doc = "X Magnetic field"]
27361 pub xmag: i16,
27362 #[doc = "Y Magnetic field"]
27363 pub ymag: i16,
27364 #[doc = "Z Magnetic field"]
27365 pub zmag: i16,
27366 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
27367 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27368 pub temperature: i16,
27369}
27370impl SCALED_IMU_DATA {
27371 pub const ENCODED_LEN: usize = 24usize;
27372 pub const DEFAULT: Self = Self {
27373 time_boot_ms: 0_u32,
27374 xacc: 0_i16,
27375 yacc: 0_i16,
27376 zacc: 0_i16,
27377 xgyro: 0_i16,
27378 ygyro: 0_i16,
27379 zgyro: 0_i16,
27380 xmag: 0_i16,
27381 ymag: 0_i16,
27382 zmag: 0_i16,
27383 temperature: 0_i16,
27384 };
27385 #[cfg(feature = "arbitrary")]
27386 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27387 use arbitrary::{Arbitrary, Unstructured};
27388 let mut buf = [0u8; 1024];
27389 rng.fill_bytes(&mut buf);
27390 let mut unstructured = Unstructured::new(&buf);
27391 Self::arbitrary(&mut unstructured).unwrap_or_default()
27392 }
27393}
27394impl Default for SCALED_IMU_DATA {
27395 fn default() -> Self {
27396 Self::DEFAULT.clone()
27397 }
27398}
27399impl MessageData for SCALED_IMU_DATA {
27400 type Message = MavMessage;
27401 const ID: u32 = 26u32;
27402 const NAME: &'static str = "SCALED_IMU";
27403 const EXTRA_CRC: u8 = 170u8;
27404 const ENCODED_LEN: usize = 24usize;
27405 fn deser(
27406 _version: MavlinkVersion,
27407 __input: &[u8],
27408 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27409 let avail_len = __input.len();
27410 let mut payload_buf = [0; Self::ENCODED_LEN];
27411 let mut buf = if avail_len < Self::ENCODED_LEN {
27412 payload_buf[0..avail_len].copy_from_slice(__input);
27413 Bytes::new(&payload_buf)
27414 } else {
27415 Bytes::new(__input)
27416 };
27417 let mut __struct = Self::default();
27418 __struct.time_boot_ms = buf.get_u32_le()?;
27419 __struct.xacc = buf.get_i16_le()?;
27420 __struct.yacc = buf.get_i16_le()?;
27421 __struct.zacc = buf.get_i16_le()?;
27422 __struct.xgyro = buf.get_i16_le()?;
27423 __struct.ygyro = buf.get_i16_le()?;
27424 __struct.zgyro = buf.get_i16_le()?;
27425 __struct.xmag = buf.get_i16_le()?;
27426 __struct.ymag = buf.get_i16_le()?;
27427 __struct.zmag = buf.get_i16_le()?;
27428 __struct.temperature = buf.get_i16_le()?;
27429 Ok(__struct)
27430 }
27431 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27432 let mut __tmp = BytesMut::new(bytes);
27433 #[allow(clippy::absurd_extreme_comparisons)]
27434 #[allow(unused_comparisons)]
27435 if __tmp.remaining() < Self::ENCODED_LEN {
27436 panic!(
27437 "buffer is too small (need {} bytes, but got {})",
27438 Self::ENCODED_LEN,
27439 __tmp.remaining(),
27440 )
27441 }
27442 __tmp.put_u32_le(self.time_boot_ms);
27443 __tmp.put_i16_le(self.xacc);
27444 __tmp.put_i16_le(self.yacc);
27445 __tmp.put_i16_le(self.zacc);
27446 __tmp.put_i16_le(self.xgyro);
27447 __tmp.put_i16_le(self.ygyro);
27448 __tmp.put_i16_le(self.zgyro);
27449 __tmp.put_i16_le(self.xmag);
27450 __tmp.put_i16_le(self.ymag);
27451 __tmp.put_i16_le(self.zmag);
27452 if matches!(version, MavlinkVersion::V2) {
27453 __tmp.put_i16_le(self.temperature);
27454 let len = __tmp.len();
27455 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27456 } else {
27457 __tmp.len()
27458 }
27459 }
27460}
27461#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
27462#[doc = ""]
27463#[doc = "ID: 116"]
27464#[derive(Debug, Clone, PartialEq)]
27465#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27466#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27467#[cfg_attr(feature = "ts", derive(TS))]
27468#[cfg_attr(feature = "ts", ts(export))]
27469pub struct SCALED_IMU2_DATA {
27470 #[doc = "Timestamp (time since system boot)."]
27471 pub time_boot_ms: u32,
27472 #[doc = "X acceleration"]
27473 pub xacc: i16,
27474 #[doc = "Y acceleration"]
27475 pub yacc: i16,
27476 #[doc = "Z acceleration"]
27477 pub zacc: i16,
27478 #[doc = "Angular speed around X axis"]
27479 pub xgyro: i16,
27480 #[doc = "Angular speed around Y axis"]
27481 pub ygyro: i16,
27482 #[doc = "Angular speed around Z axis"]
27483 pub zgyro: i16,
27484 #[doc = "X Magnetic field"]
27485 pub xmag: i16,
27486 #[doc = "Y Magnetic field"]
27487 pub ymag: i16,
27488 #[doc = "Z Magnetic field"]
27489 pub zmag: i16,
27490 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
27491 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27492 pub temperature: i16,
27493}
27494impl SCALED_IMU2_DATA {
27495 pub const ENCODED_LEN: usize = 24usize;
27496 pub const DEFAULT: Self = Self {
27497 time_boot_ms: 0_u32,
27498 xacc: 0_i16,
27499 yacc: 0_i16,
27500 zacc: 0_i16,
27501 xgyro: 0_i16,
27502 ygyro: 0_i16,
27503 zgyro: 0_i16,
27504 xmag: 0_i16,
27505 ymag: 0_i16,
27506 zmag: 0_i16,
27507 temperature: 0_i16,
27508 };
27509 #[cfg(feature = "arbitrary")]
27510 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27511 use arbitrary::{Arbitrary, Unstructured};
27512 let mut buf = [0u8; 1024];
27513 rng.fill_bytes(&mut buf);
27514 let mut unstructured = Unstructured::new(&buf);
27515 Self::arbitrary(&mut unstructured).unwrap_or_default()
27516 }
27517}
27518impl Default for SCALED_IMU2_DATA {
27519 fn default() -> Self {
27520 Self::DEFAULT.clone()
27521 }
27522}
27523impl MessageData for SCALED_IMU2_DATA {
27524 type Message = MavMessage;
27525 const ID: u32 = 116u32;
27526 const NAME: &'static str = "SCALED_IMU2";
27527 const EXTRA_CRC: u8 = 76u8;
27528 const ENCODED_LEN: usize = 24usize;
27529 fn deser(
27530 _version: MavlinkVersion,
27531 __input: &[u8],
27532 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27533 let avail_len = __input.len();
27534 let mut payload_buf = [0; Self::ENCODED_LEN];
27535 let mut buf = if avail_len < Self::ENCODED_LEN {
27536 payload_buf[0..avail_len].copy_from_slice(__input);
27537 Bytes::new(&payload_buf)
27538 } else {
27539 Bytes::new(__input)
27540 };
27541 let mut __struct = Self::default();
27542 __struct.time_boot_ms = buf.get_u32_le()?;
27543 __struct.xacc = buf.get_i16_le()?;
27544 __struct.yacc = buf.get_i16_le()?;
27545 __struct.zacc = buf.get_i16_le()?;
27546 __struct.xgyro = buf.get_i16_le()?;
27547 __struct.ygyro = buf.get_i16_le()?;
27548 __struct.zgyro = buf.get_i16_le()?;
27549 __struct.xmag = buf.get_i16_le()?;
27550 __struct.ymag = buf.get_i16_le()?;
27551 __struct.zmag = buf.get_i16_le()?;
27552 __struct.temperature = buf.get_i16_le()?;
27553 Ok(__struct)
27554 }
27555 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27556 let mut __tmp = BytesMut::new(bytes);
27557 #[allow(clippy::absurd_extreme_comparisons)]
27558 #[allow(unused_comparisons)]
27559 if __tmp.remaining() < Self::ENCODED_LEN {
27560 panic!(
27561 "buffer is too small (need {} bytes, but got {})",
27562 Self::ENCODED_LEN,
27563 __tmp.remaining(),
27564 )
27565 }
27566 __tmp.put_u32_le(self.time_boot_ms);
27567 __tmp.put_i16_le(self.xacc);
27568 __tmp.put_i16_le(self.yacc);
27569 __tmp.put_i16_le(self.zacc);
27570 __tmp.put_i16_le(self.xgyro);
27571 __tmp.put_i16_le(self.ygyro);
27572 __tmp.put_i16_le(self.zgyro);
27573 __tmp.put_i16_le(self.xmag);
27574 __tmp.put_i16_le(self.ymag);
27575 __tmp.put_i16_le(self.zmag);
27576 if matches!(version, MavlinkVersion::V2) {
27577 __tmp.put_i16_le(self.temperature);
27578 let len = __tmp.len();
27579 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27580 } else {
27581 __tmp.len()
27582 }
27583 }
27584}
27585#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
27586#[doc = ""]
27587#[doc = "ID: 129"]
27588#[derive(Debug, Clone, PartialEq)]
27589#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27590#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27591#[cfg_attr(feature = "ts", derive(TS))]
27592#[cfg_attr(feature = "ts", ts(export))]
27593pub struct SCALED_IMU3_DATA {
27594 #[doc = "Timestamp (time since system boot)."]
27595 pub time_boot_ms: u32,
27596 #[doc = "X acceleration"]
27597 pub xacc: i16,
27598 #[doc = "Y acceleration"]
27599 pub yacc: i16,
27600 #[doc = "Z acceleration"]
27601 pub zacc: i16,
27602 #[doc = "Angular speed around X axis"]
27603 pub xgyro: i16,
27604 #[doc = "Angular speed around Y axis"]
27605 pub ygyro: i16,
27606 #[doc = "Angular speed around Z axis"]
27607 pub zgyro: i16,
27608 #[doc = "X Magnetic field"]
27609 pub xmag: i16,
27610 #[doc = "Y Magnetic field"]
27611 pub ymag: i16,
27612 #[doc = "Z Magnetic field"]
27613 pub zmag: i16,
27614 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
27615 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27616 pub temperature: i16,
27617}
27618impl SCALED_IMU3_DATA {
27619 pub const ENCODED_LEN: usize = 24usize;
27620 pub const DEFAULT: Self = Self {
27621 time_boot_ms: 0_u32,
27622 xacc: 0_i16,
27623 yacc: 0_i16,
27624 zacc: 0_i16,
27625 xgyro: 0_i16,
27626 ygyro: 0_i16,
27627 zgyro: 0_i16,
27628 xmag: 0_i16,
27629 ymag: 0_i16,
27630 zmag: 0_i16,
27631 temperature: 0_i16,
27632 };
27633 #[cfg(feature = "arbitrary")]
27634 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27635 use arbitrary::{Arbitrary, Unstructured};
27636 let mut buf = [0u8; 1024];
27637 rng.fill_bytes(&mut buf);
27638 let mut unstructured = Unstructured::new(&buf);
27639 Self::arbitrary(&mut unstructured).unwrap_or_default()
27640 }
27641}
27642impl Default for SCALED_IMU3_DATA {
27643 fn default() -> Self {
27644 Self::DEFAULT.clone()
27645 }
27646}
27647impl MessageData for SCALED_IMU3_DATA {
27648 type Message = MavMessage;
27649 const ID: u32 = 129u32;
27650 const NAME: &'static str = "SCALED_IMU3";
27651 const EXTRA_CRC: u8 = 46u8;
27652 const ENCODED_LEN: usize = 24usize;
27653 fn deser(
27654 _version: MavlinkVersion,
27655 __input: &[u8],
27656 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27657 let avail_len = __input.len();
27658 let mut payload_buf = [0; Self::ENCODED_LEN];
27659 let mut buf = if avail_len < Self::ENCODED_LEN {
27660 payload_buf[0..avail_len].copy_from_slice(__input);
27661 Bytes::new(&payload_buf)
27662 } else {
27663 Bytes::new(__input)
27664 };
27665 let mut __struct = Self::default();
27666 __struct.time_boot_ms = buf.get_u32_le()?;
27667 __struct.xacc = buf.get_i16_le()?;
27668 __struct.yacc = buf.get_i16_le()?;
27669 __struct.zacc = buf.get_i16_le()?;
27670 __struct.xgyro = buf.get_i16_le()?;
27671 __struct.ygyro = buf.get_i16_le()?;
27672 __struct.zgyro = buf.get_i16_le()?;
27673 __struct.xmag = buf.get_i16_le()?;
27674 __struct.ymag = buf.get_i16_le()?;
27675 __struct.zmag = buf.get_i16_le()?;
27676 __struct.temperature = buf.get_i16_le()?;
27677 Ok(__struct)
27678 }
27679 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27680 let mut __tmp = BytesMut::new(bytes);
27681 #[allow(clippy::absurd_extreme_comparisons)]
27682 #[allow(unused_comparisons)]
27683 if __tmp.remaining() < Self::ENCODED_LEN {
27684 panic!(
27685 "buffer is too small (need {} bytes, but got {})",
27686 Self::ENCODED_LEN,
27687 __tmp.remaining(),
27688 )
27689 }
27690 __tmp.put_u32_le(self.time_boot_ms);
27691 __tmp.put_i16_le(self.xacc);
27692 __tmp.put_i16_le(self.yacc);
27693 __tmp.put_i16_le(self.zacc);
27694 __tmp.put_i16_le(self.xgyro);
27695 __tmp.put_i16_le(self.ygyro);
27696 __tmp.put_i16_le(self.zgyro);
27697 __tmp.put_i16_le(self.xmag);
27698 __tmp.put_i16_le(self.ymag);
27699 __tmp.put_i16_le(self.zmag);
27700 if matches!(version, MavlinkVersion::V2) {
27701 __tmp.put_i16_le(self.temperature);
27702 let len = __tmp.len();
27703 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27704 } else {
27705 __tmp.len()
27706 }
27707 }
27708}
27709#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
27710#[doc = ""]
27711#[doc = "ID: 29"]
27712#[derive(Debug, Clone, PartialEq)]
27713#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27714#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27715#[cfg_attr(feature = "ts", derive(TS))]
27716#[cfg_attr(feature = "ts", ts(export))]
27717pub struct SCALED_PRESSURE_DATA {
27718 #[doc = "Timestamp (time since system boot)."]
27719 pub time_boot_ms: u32,
27720 #[doc = "Absolute pressure"]
27721 pub press_abs: f32,
27722 #[doc = "Differential pressure 1"]
27723 pub press_diff: f32,
27724 #[doc = "Absolute pressure temperature"]
27725 pub temperature: i16,
27726 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27727 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27728 pub temperature_press_diff: i16,
27729}
27730impl SCALED_PRESSURE_DATA {
27731 pub const ENCODED_LEN: usize = 16usize;
27732 pub const DEFAULT: Self = Self {
27733 time_boot_ms: 0_u32,
27734 press_abs: 0.0_f32,
27735 press_diff: 0.0_f32,
27736 temperature: 0_i16,
27737 temperature_press_diff: 0_i16,
27738 };
27739 #[cfg(feature = "arbitrary")]
27740 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27741 use arbitrary::{Arbitrary, Unstructured};
27742 let mut buf = [0u8; 1024];
27743 rng.fill_bytes(&mut buf);
27744 let mut unstructured = Unstructured::new(&buf);
27745 Self::arbitrary(&mut unstructured).unwrap_or_default()
27746 }
27747}
27748impl Default for SCALED_PRESSURE_DATA {
27749 fn default() -> Self {
27750 Self::DEFAULT.clone()
27751 }
27752}
27753impl MessageData for SCALED_PRESSURE_DATA {
27754 type Message = MavMessage;
27755 const ID: u32 = 29u32;
27756 const NAME: &'static str = "SCALED_PRESSURE";
27757 const EXTRA_CRC: u8 = 115u8;
27758 const ENCODED_LEN: usize = 16usize;
27759 fn deser(
27760 _version: MavlinkVersion,
27761 __input: &[u8],
27762 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27763 let avail_len = __input.len();
27764 let mut payload_buf = [0; Self::ENCODED_LEN];
27765 let mut buf = if avail_len < Self::ENCODED_LEN {
27766 payload_buf[0..avail_len].copy_from_slice(__input);
27767 Bytes::new(&payload_buf)
27768 } else {
27769 Bytes::new(__input)
27770 };
27771 let mut __struct = Self::default();
27772 __struct.time_boot_ms = buf.get_u32_le()?;
27773 __struct.press_abs = buf.get_f32_le()?;
27774 __struct.press_diff = buf.get_f32_le()?;
27775 __struct.temperature = buf.get_i16_le()?;
27776 __struct.temperature_press_diff = buf.get_i16_le()?;
27777 Ok(__struct)
27778 }
27779 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27780 let mut __tmp = BytesMut::new(bytes);
27781 #[allow(clippy::absurd_extreme_comparisons)]
27782 #[allow(unused_comparisons)]
27783 if __tmp.remaining() < Self::ENCODED_LEN {
27784 panic!(
27785 "buffer is too small (need {} bytes, but got {})",
27786 Self::ENCODED_LEN,
27787 __tmp.remaining(),
27788 )
27789 }
27790 __tmp.put_u32_le(self.time_boot_ms);
27791 __tmp.put_f32_le(self.press_abs);
27792 __tmp.put_f32_le(self.press_diff);
27793 __tmp.put_i16_le(self.temperature);
27794 if matches!(version, MavlinkVersion::V2) {
27795 __tmp.put_i16_le(self.temperature_press_diff);
27796 let len = __tmp.len();
27797 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27798 } else {
27799 __tmp.len()
27800 }
27801 }
27802}
27803#[doc = "Barometer readings for 2nd barometer."]
27804#[doc = ""]
27805#[doc = "ID: 137"]
27806#[derive(Debug, Clone, PartialEq)]
27807#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27808#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27809#[cfg_attr(feature = "ts", derive(TS))]
27810#[cfg_attr(feature = "ts", ts(export))]
27811pub struct SCALED_PRESSURE2_DATA {
27812 #[doc = "Timestamp (time since system boot)."]
27813 pub time_boot_ms: u32,
27814 #[doc = "Absolute pressure"]
27815 pub press_abs: f32,
27816 #[doc = "Differential pressure"]
27817 pub press_diff: f32,
27818 #[doc = "Absolute pressure temperature"]
27819 pub temperature: i16,
27820 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27821 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27822 pub temperature_press_diff: i16,
27823}
27824impl SCALED_PRESSURE2_DATA {
27825 pub const ENCODED_LEN: usize = 16usize;
27826 pub const DEFAULT: Self = Self {
27827 time_boot_ms: 0_u32,
27828 press_abs: 0.0_f32,
27829 press_diff: 0.0_f32,
27830 temperature: 0_i16,
27831 temperature_press_diff: 0_i16,
27832 };
27833 #[cfg(feature = "arbitrary")]
27834 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27835 use arbitrary::{Arbitrary, Unstructured};
27836 let mut buf = [0u8; 1024];
27837 rng.fill_bytes(&mut buf);
27838 let mut unstructured = Unstructured::new(&buf);
27839 Self::arbitrary(&mut unstructured).unwrap_or_default()
27840 }
27841}
27842impl Default for SCALED_PRESSURE2_DATA {
27843 fn default() -> Self {
27844 Self::DEFAULT.clone()
27845 }
27846}
27847impl MessageData for SCALED_PRESSURE2_DATA {
27848 type Message = MavMessage;
27849 const ID: u32 = 137u32;
27850 const NAME: &'static str = "SCALED_PRESSURE2";
27851 const EXTRA_CRC: u8 = 195u8;
27852 const ENCODED_LEN: usize = 16usize;
27853 fn deser(
27854 _version: MavlinkVersion,
27855 __input: &[u8],
27856 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27857 let avail_len = __input.len();
27858 let mut payload_buf = [0; Self::ENCODED_LEN];
27859 let mut buf = if avail_len < Self::ENCODED_LEN {
27860 payload_buf[0..avail_len].copy_from_slice(__input);
27861 Bytes::new(&payload_buf)
27862 } else {
27863 Bytes::new(__input)
27864 };
27865 let mut __struct = Self::default();
27866 __struct.time_boot_ms = buf.get_u32_le()?;
27867 __struct.press_abs = buf.get_f32_le()?;
27868 __struct.press_diff = buf.get_f32_le()?;
27869 __struct.temperature = buf.get_i16_le()?;
27870 __struct.temperature_press_diff = buf.get_i16_le()?;
27871 Ok(__struct)
27872 }
27873 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27874 let mut __tmp = BytesMut::new(bytes);
27875 #[allow(clippy::absurd_extreme_comparisons)]
27876 #[allow(unused_comparisons)]
27877 if __tmp.remaining() < Self::ENCODED_LEN {
27878 panic!(
27879 "buffer is too small (need {} bytes, but got {})",
27880 Self::ENCODED_LEN,
27881 __tmp.remaining(),
27882 )
27883 }
27884 __tmp.put_u32_le(self.time_boot_ms);
27885 __tmp.put_f32_le(self.press_abs);
27886 __tmp.put_f32_le(self.press_diff);
27887 __tmp.put_i16_le(self.temperature);
27888 if matches!(version, MavlinkVersion::V2) {
27889 __tmp.put_i16_le(self.temperature_press_diff);
27890 let len = __tmp.len();
27891 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27892 } else {
27893 __tmp.len()
27894 }
27895 }
27896}
27897#[doc = "Barometer readings for 3rd barometer."]
27898#[doc = ""]
27899#[doc = "ID: 143"]
27900#[derive(Debug, Clone, PartialEq)]
27901#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27902#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27903#[cfg_attr(feature = "ts", derive(TS))]
27904#[cfg_attr(feature = "ts", ts(export))]
27905pub struct SCALED_PRESSURE3_DATA {
27906 #[doc = "Timestamp (time since system boot)."]
27907 pub time_boot_ms: u32,
27908 #[doc = "Absolute pressure"]
27909 pub press_abs: f32,
27910 #[doc = "Differential pressure"]
27911 pub press_diff: f32,
27912 #[doc = "Absolute pressure temperature"]
27913 pub temperature: i16,
27914 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27915 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27916 pub temperature_press_diff: i16,
27917}
27918impl SCALED_PRESSURE3_DATA {
27919 pub const ENCODED_LEN: usize = 16usize;
27920 pub const DEFAULT: Self = Self {
27921 time_boot_ms: 0_u32,
27922 press_abs: 0.0_f32,
27923 press_diff: 0.0_f32,
27924 temperature: 0_i16,
27925 temperature_press_diff: 0_i16,
27926 };
27927 #[cfg(feature = "arbitrary")]
27928 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27929 use arbitrary::{Arbitrary, Unstructured};
27930 let mut buf = [0u8; 1024];
27931 rng.fill_bytes(&mut buf);
27932 let mut unstructured = Unstructured::new(&buf);
27933 Self::arbitrary(&mut unstructured).unwrap_or_default()
27934 }
27935}
27936impl Default for SCALED_PRESSURE3_DATA {
27937 fn default() -> Self {
27938 Self::DEFAULT.clone()
27939 }
27940}
27941impl MessageData for SCALED_PRESSURE3_DATA {
27942 type Message = MavMessage;
27943 const ID: u32 = 143u32;
27944 const NAME: &'static str = "SCALED_PRESSURE3";
27945 const EXTRA_CRC: u8 = 131u8;
27946 const ENCODED_LEN: usize = 16usize;
27947 fn deser(
27948 _version: MavlinkVersion,
27949 __input: &[u8],
27950 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27951 let avail_len = __input.len();
27952 let mut payload_buf = [0; Self::ENCODED_LEN];
27953 let mut buf = if avail_len < Self::ENCODED_LEN {
27954 payload_buf[0..avail_len].copy_from_slice(__input);
27955 Bytes::new(&payload_buf)
27956 } else {
27957 Bytes::new(__input)
27958 };
27959 let mut __struct = Self::default();
27960 __struct.time_boot_ms = buf.get_u32_le()?;
27961 __struct.press_abs = buf.get_f32_le()?;
27962 __struct.press_diff = buf.get_f32_le()?;
27963 __struct.temperature = buf.get_i16_le()?;
27964 __struct.temperature_press_diff = buf.get_i16_le()?;
27965 Ok(__struct)
27966 }
27967 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27968 let mut __tmp = BytesMut::new(bytes);
27969 #[allow(clippy::absurd_extreme_comparisons)]
27970 #[allow(unused_comparisons)]
27971 if __tmp.remaining() < Self::ENCODED_LEN {
27972 panic!(
27973 "buffer is too small (need {} bytes, but got {})",
27974 Self::ENCODED_LEN,
27975 __tmp.remaining(),
27976 )
27977 }
27978 __tmp.put_u32_le(self.time_boot_ms);
27979 __tmp.put_f32_le(self.press_abs);
27980 __tmp.put_f32_le(self.press_diff);
27981 __tmp.put_i16_le(self.temperature);
27982 if matches!(version, MavlinkVersion::V2) {
27983 __tmp.put_i16_le(self.temperature_press_diff);
27984 let len = __tmp.len();
27985 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27986 } else {
27987 __tmp.len()
27988 }
27989 }
27990}
27991#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
27992#[doc = ""]
27993#[doc = "ID: 126"]
27994#[derive(Debug, Clone, PartialEq)]
27995#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27996#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27997#[cfg_attr(feature = "ts", derive(TS))]
27998#[cfg_attr(feature = "ts", ts(export))]
27999pub struct SERIAL_CONTROL_DATA {
28000 #[doc = "Baudrate of transfer. Zero means no change."]
28001 pub baudrate: u32,
28002 #[doc = "Timeout for reply data"]
28003 pub timeout: u16,
28004 #[doc = "Serial control device type."]
28005 pub device: SerialControlDev,
28006 #[doc = "Bitmap of serial control flags."]
28007 pub flags: SerialControlFlag,
28008 #[doc = "how many bytes in this transfer"]
28009 pub count: u8,
28010 #[doc = "serial data"]
28011 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28012 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28013 pub data: [u8; 70],
28014 #[doc = "System ID"]
28015 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28016 pub target_system: u8,
28017 #[doc = "Component ID"]
28018 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28019 pub target_component: u8,
28020}
28021impl SERIAL_CONTROL_DATA {
28022 pub const ENCODED_LEN: usize = 81usize;
28023 pub const DEFAULT: Self = Self {
28024 baudrate: 0_u32,
28025 timeout: 0_u16,
28026 device: SerialControlDev::DEFAULT,
28027 flags: SerialControlFlag::DEFAULT,
28028 count: 0_u8,
28029 data: [0_u8; 70usize],
28030 target_system: 0_u8,
28031 target_component: 0_u8,
28032 };
28033 #[cfg(feature = "arbitrary")]
28034 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28035 use arbitrary::{Arbitrary, Unstructured};
28036 let mut buf = [0u8; 1024];
28037 rng.fill_bytes(&mut buf);
28038 let mut unstructured = Unstructured::new(&buf);
28039 Self::arbitrary(&mut unstructured).unwrap_or_default()
28040 }
28041}
28042impl Default for SERIAL_CONTROL_DATA {
28043 fn default() -> Self {
28044 Self::DEFAULT.clone()
28045 }
28046}
28047impl MessageData for SERIAL_CONTROL_DATA {
28048 type Message = MavMessage;
28049 const ID: u32 = 126u32;
28050 const NAME: &'static str = "SERIAL_CONTROL";
28051 const EXTRA_CRC: u8 = 220u8;
28052 const ENCODED_LEN: usize = 81usize;
28053 fn deser(
28054 _version: MavlinkVersion,
28055 __input: &[u8],
28056 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28057 let avail_len = __input.len();
28058 let mut payload_buf = [0; Self::ENCODED_LEN];
28059 let mut buf = if avail_len < Self::ENCODED_LEN {
28060 payload_buf[0..avail_len].copy_from_slice(__input);
28061 Bytes::new(&payload_buf)
28062 } else {
28063 Bytes::new(__input)
28064 };
28065 let mut __struct = Self::default();
28066 __struct.baudrate = buf.get_u32_le()?;
28067 __struct.timeout = buf.get_u16_le()?;
28068 let tmp = buf.get_u8()?;
28069 __struct.device =
28070 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28071 enum_type: "SerialControlDev",
28072 value: tmp as u64,
28073 })?;
28074 let tmp = buf.get_u8()?;
28075 __struct.flags = SerialControlFlag::from_bits(tmp as <SerialControlFlag as Flags>::Bits)
28076 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28077 flag_type: "SerialControlFlag",
28078 value: tmp as u64,
28079 })?;
28080 __struct.count = buf.get_u8()?;
28081 for v in &mut __struct.data {
28082 let val = buf.get_u8()?;
28083 *v = val;
28084 }
28085 __struct.target_system = buf.get_u8()?;
28086 __struct.target_component = buf.get_u8()?;
28087 Ok(__struct)
28088 }
28089 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28090 let mut __tmp = BytesMut::new(bytes);
28091 #[allow(clippy::absurd_extreme_comparisons)]
28092 #[allow(unused_comparisons)]
28093 if __tmp.remaining() < Self::ENCODED_LEN {
28094 panic!(
28095 "buffer is too small (need {} bytes, but got {})",
28096 Self::ENCODED_LEN,
28097 __tmp.remaining(),
28098 )
28099 }
28100 __tmp.put_u32_le(self.baudrate);
28101 __tmp.put_u16_le(self.timeout);
28102 __tmp.put_u8(self.device as u8);
28103 __tmp.put_u8(self.flags.bits() as u8);
28104 __tmp.put_u8(self.count);
28105 for val in &self.data {
28106 __tmp.put_u8(*val);
28107 }
28108 if matches!(version, MavlinkVersion::V2) {
28109 __tmp.put_u8(self.target_system);
28110 __tmp.put_u8(self.target_component);
28111 let len = __tmp.len();
28112 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28113 } else {
28114 __tmp.len()
28115 }
28116 }
28117}
28118#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F13: format."]
28119#[doc = ""]
28120#[doc = "ID: 177"]
28121#[derive(Debug, Clone, PartialEq)]
28122#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28123#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28124#[cfg_attr(feature = "ts", derive(TS))]
28125#[cfg_attr(feature = "ts", ts(export))]
28126pub struct SERIAL_UDB_EXTRA_F13_DATA {
28127 #[doc = "Serial UDB Extra MP Origin Latitude"]
28128 pub sue_lat_origin: i32,
28129 #[doc = "Serial UDB Extra MP Origin Longitude"]
28130 pub sue_lon_origin: i32,
28131 #[doc = "Serial UDB Extra MP Origin Altitude Above Sea Level"]
28132 pub sue_alt_origin: i32,
28133 #[doc = "Serial UDB Extra GPS Week Number"]
28134 pub sue_week_no: i16,
28135}
28136impl SERIAL_UDB_EXTRA_F13_DATA {
28137 pub const ENCODED_LEN: usize = 14usize;
28138 pub const DEFAULT: Self = Self {
28139 sue_lat_origin: 0_i32,
28140 sue_lon_origin: 0_i32,
28141 sue_alt_origin: 0_i32,
28142 sue_week_no: 0_i16,
28143 };
28144 #[cfg(feature = "arbitrary")]
28145 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28146 use arbitrary::{Arbitrary, Unstructured};
28147 let mut buf = [0u8; 1024];
28148 rng.fill_bytes(&mut buf);
28149 let mut unstructured = Unstructured::new(&buf);
28150 Self::arbitrary(&mut unstructured).unwrap_or_default()
28151 }
28152}
28153impl Default for SERIAL_UDB_EXTRA_F13_DATA {
28154 fn default() -> Self {
28155 Self::DEFAULT.clone()
28156 }
28157}
28158impl MessageData for SERIAL_UDB_EXTRA_F13_DATA {
28159 type Message = MavMessage;
28160 const ID: u32 = 177u32;
28161 const NAME: &'static str = "SERIAL_UDB_EXTRA_F13";
28162 const EXTRA_CRC: u8 = 249u8;
28163 const ENCODED_LEN: usize = 14usize;
28164 fn deser(
28165 _version: MavlinkVersion,
28166 __input: &[u8],
28167 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28168 let avail_len = __input.len();
28169 let mut payload_buf = [0; Self::ENCODED_LEN];
28170 let mut buf = if avail_len < Self::ENCODED_LEN {
28171 payload_buf[0..avail_len].copy_from_slice(__input);
28172 Bytes::new(&payload_buf)
28173 } else {
28174 Bytes::new(__input)
28175 };
28176 let mut __struct = Self::default();
28177 __struct.sue_lat_origin = buf.get_i32_le()?;
28178 __struct.sue_lon_origin = buf.get_i32_le()?;
28179 __struct.sue_alt_origin = buf.get_i32_le()?;
28180 __struct.sue_week_no = buf.get_i16_le()?;
28181 Ok(__struct)
28182 }
28183 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28184 let mut __tmp = BytesMut::new(bytes);
28185 #[allow(clippy::absurd_extreme_comparisons)]
28186 #[allow(unused_comparisons)]
28187 if __tmp.remaining() < Self::ENCODED_LEN {
28188 panic!(
28189 "buffer is too small (need {} bytes, but got {})",
28190 Self::ENCODED_LEN,
28191 __tmp.remaining(),
28192 )
28193 }
28194 __tmp.put_i32_le(self.sue_lat_origin);
28195 __tmp.put_i32_le(self.sue_lon_origin);
28196 __tmp.put_i32_le(self.sue_alt_origin);
28197 __tmp.put_i16_le(self.sue_week_no);
28198 if matches!(version, MavlinkVersion::V2) {
28199 let len = __tmp.len();
28200 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28201 } else {
28202 __tmp.len()
28203 }
28204 }
28205}
28206#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F14: format."]
28207#[doc = ""]
28208#[doc = "ID: 178"]
28209#[derive(Debug, Clone, PartialEq)]
28210#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28211#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28212#[cfg_attr(feature = "ts", derive(TS))]
28213#[cfg_attr(feature = "ts", ts(export))]
28214pub struct SERIAL_UDB_EXTRA_F14_DATA {
28215 #[doc = "Serial UDB Extra Type Program Address of Last Trap"]
28216 pub sue_TRAP_SOURCE: u32,
28217 #[doc = "Serial UDB Extra Reboot Register of DSPIC"]
28218 pub sue_RCON: i16,
28219 #[doc = "Serial UDB Extra Last dspic Trap Flags"]
28220 pub sue_TRAP_FLAGS: i16,
28221 #[doc = "Serial UDB Extra Number of Ocillator Failures"]
28222 pub sue_osc_fail_count: i16,
28223 #[doc = "Serial UDB Extra Wind Estimation Enabled"]
28224 pub sue_WIND_ESTIMATION: u8,
28225 #[doc = "Serial UDB Extra Type of GPS Unit"]
28226 pub sue_GPS_TYPE: u8,
28227 #[doc = "Serial UDB Extra Dead Reckoning Enabled"]
28228 pub sue_DR: u8,
28229 #[doc = "Serial UDB Extra Type of UDB Hardware"]
28230 pub sue_BOARD_TYPE: u8,
28231 #[doc = "Serial UDB Extra Type of Airframe"]
28232 pub sue_AIRFRAME: u8,
28233 #[doc = "Serial UDB Extra UDB Internal Clock Configuration"]
28234 pub sue_CLOCK_CONFIG: u8,
28235 #[doc = "Serial UDB Extra Type of Flight Plan"]
28236 pub sue_FLIGHT_PLAN_TYPE: u8,
28237}
28238impl SERIAL_UDB_EXTRA_F14_DATA {
28239 pub const ENCODED_LEN: usize = 17usize;
28240 pub const DEFAULT: Self = Self {
28241 sue_TRAP_SOURCE: 0_u32,
28242 sue_RCON: 0_i16,
28243 sue_TRAP_FLAGS: 0_i16,
28244 sue_osc_fail_count: 0_i16,
28245 sue_WIND_ESTIMATION: 0_u8,
28246 sue_GPS_TYPE: 0_u8,
28247 sue_DR: 0_u8,
28248 sue_BOARD_TYPE: 0_u8,
28249 sue_AIRFRAME: 0_u8,
28250 sue_CLOCK_CONFIG: 0_u8,
28251 sue_FLIGHT_PLAN_TYPE: 0_u8,
28252 };
28253 #[cfg(feature = "arbitrary")]
28254 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28255 use arbitrary::{Arbitrary, Unstructured};
28256 let mut buf = [0u8; 1024];
28257 rng.fill_bytes(&mut buf);
28258 let mut unstructured = Unstructured::new(&buf);
28259 Self::arbitrary(&mut unstructured).unwrap_or_default()
28260 }
28261}
28262impl Default for SERIAL_UDB_EXTRA_F14_DATA {
28263 fn default() -> Self {
28264 Self::DEFAULT.clone()
28265 }
28266}
28267impl MessageData for SERIAL_UDB_EXTRA_F14_DATA {
28268 type Message = MavMessage;
28269 const ID: u32 = 178u32;
28270 const NAME: &'static str = "SERIAL_UDB_EXTRA_F14";
28271 const EXTRA_CRC: u8 = 123u8;
28272 const ENCODED_LEN: usize = 17usize;
28273 fn deser(
28274 _version: MavlinkVersion,
28275 __input: &[u8],
28276 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28277 let avail_len = __input.len();
28278 let mut payload_buf = [0; Self::ENCODED_LEN];
28279 let mut buf = if avail_len < Self::ENCODED_LEN {
28280 payload_buf[0..avail_len].copy_from_slice(__input);
28281 Bytes::new(&payload_buf)
28282 } else {
28283 Bytes::new(__input)
28284 };
28285 let mut __struct = Self::default();
28286 __struct.sue_TRAP_SOURCE = buf.get_u32_le()?;
28287 __struct.sue_RCON = buf.get_i16_le()?;
28288 __struct.sue_TRAP_FLAGS = buf.get_i16_le()?;
28289 __struct.sue_osc_fail_count = buf.get_i16_le()?;
28290 __struct.sue_WIND_ESTIMATION = buf.get_u8()?;
28291 __struct.sue_GPS_TYPE = buf.get_u8()?;
28292 __struct.sue_DR = buf.get_u8()?;
28293 __struct.sue_BOARD_TYPE = buf.get_u8()?;
28294 __struct.sue_AIRFRAME = buf.get_u8()?;
28295 __struct.sue_CLOCK_CONFIG = buf.get_u8()?;
28296 __struct.sue_FLIGHT_PLAN_TYPE = buf.get_u8()?;
28297 Ok(__struct)
28298 }
28299 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28300 let mut __tmp = BytesMut::new(bytes);
28301 #[allow(clippy::absurd_extreme_comparisons)]
28302 #[allow(unused_comparisons)]
28303 if __tmp.remaining() < Self::ENCODED_LEN {
28304 panic!(
28305 "buffer is too small (need {} bytes, but got {})",
28306 Self::ENCODED_LEN,
28307 __tmp.remaining(),
28308 )
28309 }
28310 __tmp.put_u32_le(self.sue_TRAP_SOURCE);
28311 __tmp.put_i16_le(self.sue_RCON);
28312 __tmp.put_i16_le(self.sue_TRAP_FLAGS);
28313 __tmp.put_i16_le(self.sue_osc_fail_count);
28314 __tmp.put_u8(self.sue_WIND_ESTIMATION);
28315 __tmp.put_u8(self.sue_GPS_TYPE);
28316 __tmp.put_u8(self.sue_DR);
28317 __tmp.put_u8(self.sue_BOARD_TYPE);
28318 __tmp.put_u8(self.sue_AIRFRAME);
28319 __tmp.put_u8(self.sue_CLOCK_CONFIG);
28320 __tmp.put_u8(self.sue_FLIGHT_PLAN_TYPE);
28321 if matches!(version, MavlinkVersion::V2) {
28322 let len = __tmp.len();
28323 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28324 } else {
28325 __tmp.len()
28326 }
28327 }
28328}
28329#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F15 format."]
28330#[doc = ""]
28331#[doc = "ID: 179"]
28332#[derive(Debug, Clone, PartialEq)]
28333#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28334#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28335#[cfg_attr(feature = "ts", derive(TS))]
28336#[cfg_attr(feature = "ts", ts(export))]
28337pub struct SERIAL_UDB_EXTRA_F15_DATA {
28338 #[doc = "Serial UDB Extra Model Name Of Vehicle"]
28339 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28340 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28341 pub sue_ID_VEHICLE_MODEL_NAME: [u8; 40],
28342 #[doc = "Serial UDB Extra Registraton Number of Vehicle"]
28343 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28344 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28345 pub sue_ID_VEHICLE_REGISTRATION: [u8; 20],
28346}
28347impl SERIAL_UDB_EXTRA_F15_DATA {
28348 pub const ENCODED_LEN: usize = 60usize;
28349 pub const DEFAULT: Self = Self {
28350 sue_ID_VEHICLE_MODEL_NAME: [0_u8; 40usize],
28351 sue_ID_VEHICLE_REGISTRATION: [0_u8; 20usize],
28352 };
28353 #[cfg(feature = "arbitrary")]
28354 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28355 use arbitrary::{Arbitrary, Unstructured};
28356 let mut buf = [0u8; 1024];
28357 rng.fill_bytes(&mut buf);
28358 let mut unstructured = Unstructured::new(&buf);
28359 Self::arbitrary(&mut unstructured).unwrap_or_default()
28360 }
28361}
28362impl Default for SERIAL_UDB_EXTRA_F15_DATA {
28363 fn default() -> Self {
28364 Self::DEFAULT.clone()
28365 }
28366}
28367impl MessageData for SERIAL_UDB_EXTRA_F15_DATA {
28368 type Message = MavMessage;
28369 const ID: u32 = 179u32;
28370 const NAME: &'static str = "SERIAL_UDB_EXTRA_F15";
28371 const EXTRA_CRC: u8 = 7u8;
28372 const ENCODED_LEN: usize = 60usize;
28373 fn deser(
28374 _version: MavlinkVersion,
28375 __input: &[u8],
28376 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28377 let avail_len = __input.len();
28378 let mut payload_buf = [0; Self::ENCODED_LEN];
28379 let mut buf = if avail_len < Self::ENCODED_LEN {
28380 payload_buf[0..avail_len].copy_from_slice(__input);
28381 Bytes::new(&payload_buf)
28382 } else {
28383 Bytes::new(__input)
28384 };
28385 let mut __struct = Self::default();
28386 for v in &mut __struct.sue_ID_VEHICLE_MODEL_NAME {
28387 let val = buf.get_u8()?;
28388 *v = val;
28389 }
28390 for v in &mut __struct.sue_ID_VEHICLE_REGISTRATION {
28391 let val = buf.get_u8()?;
28392 *v = val;
28393 }
28394 Ok(__struct)
28395 }
28396 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28397 let mut __tmp = BytesMut::new(bytes);
28398 #[allow(clippy::absurd_extreme_comparisons)]
28399 #[allow(unused_comparisons)]
28400 if __tmp.remaining() < Self::ENCODED_LEN {
28401 panic!(
28402 "buffer is too small (need {} bytes, but got {})",
28403 Self::ENCODED_LEN,
28404 __tmp.remaining(),
28405 )
28406 }
28407 for val in &self.sue_ID_VEHICLE_MODEL_NAME {
28408 __tmp.put_u8(*val);
28409 }
28410 for val in &self.sue_ID_VEHICLE_REGISTRATION {
28411 __tmp.put_u8(*val);
28412 }
28413 if matches!(version, MavlinkVersion::V2) {
28414 let len = __tmp.len();
28415 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28416 } else {
28417 __tmp.len()
28418 }
28419 }
28420}
28421#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F16 format."]
28422#[doc = ""]
28423#[doc = "ID: 180"]
28424#[derive(Debug, Clone, PartialEq)]
28425#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28426#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28427#[cfg_attr(feature = "ts", derive(TS))]
28428#[cfg_attr(feature = "ts", ts(export))]
28429pub struct SERIAL_UDB_EXTRA_F16_DATA {
28430 #[doc = "Serial UDB Extra Name of Expected Lead Pilot"]
28431 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28432 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28433 pub sue_ID_LEAD_PILOT: [u8; 40],
28434 #[doc = "Serial UDB Extra URL of Lead Pilot or Team"]
28435 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28436 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28437 pub sue_ID_DIY_DRONES_URL: [u8; 70],
28438}
28439impl SERIAL_UDB_EXTRA_F16_DATA {
28440 pub const ENCODED_LEN: usize = 110usize;
28441 pub const DEFAULT: Self = Self {
28442 sue_ID_LEAD_PILOT: [0_u8; 40usize],
28443 sue_ID_DIY_DRONES_URL: [0_u8; 70usize],
28444 };
28445 #[cfg(feature = "arbitrary")]
28446 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28447 use arbitrary::{Arbitrary, Unstructured};
28448 let mut buf = [0u8; 1024];
28449 rng.fill_bytes(&mut buf);
28450 let mut unstructured = Unstructured::new(&buf);
28451 Self::arbitrary(&mut unstructured).unwrap_or_default()
28452 }
28453}
28454impl Default for SERIAL_UDB_EXTRA_F16_DATA {
28455 fn default() -> Self {
28456 Self::DEFAULT.clone()
28457 }
28458}
28459impl MessageData for SERIAL_UDB_EXTRA_F16_DATA {
28460 type Message = MavMessage;
28461 const ID: u32 = 180u32;
28462 const NAME: &'static str = "SERIAL_UDB_EXTRA_F16";
28463 const EXTRA_CRC: u8 = 222u8;
28464 const ENCODED_LEN: usize = 110usize;
28465 fn deser(
28466 _version: MavlinkVersion,
28467 __input: &[u8],
28468 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28469 let avail_len = __input.len();
28470 let mut payload_buf = [0; Self::ENCODED_LEN];
28471 let mut buf = if avail_len < Self::ENCODED_LEN {
28472 payload_buf[0..avail_len].copy_from_slice(__input);
28473 Bytes::new(&payload_buf)
28474 } else {
28475 Bytes::new(__input)
28476 };
28477 let mut __struct = Self::default();
28478 for v in &mut __struct.sue_ID_LEAD_PILOT {
28479 let val = buf.get_u8()?;
28480 *v = val;
28481 }
28482 for v in &mut __struct.sue_ID_DIY_DRONES_URL {
28483 let val = buf.get_u8()?;
28484 *v = val;
28485 }
28486 Ok(__struct)
28487 }
28488 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28489 let mut __tmp = BytesMut::new(bytes);
28490 #[allow(clippy::absurd_extreme_comparisons)]
28491 #[allow(unused_comparisons)]
28492 if __tmp.remaining() < Self::ENCODED_LEN {
28493 panic!(
28494 "buffer is too small (need {} bytes, but got {})",
28495 Self::ENCODED_LEN,
28496 __tmp.remaining(),
28497 )
28498 }
28499 for val in &self.sue_ID_LEAD_PILOT {
28500 __tmp.put_u8(*val);
28501 }
28502 for val in &self.sue_ID_DIY_DRONES_URL {
28503 __tmp.put_u8(*val);
28504 }
28505 if matches!(version, MavlinkVersion::V2) {
28506 let len = __tmp.len();
28507 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28508 } else {
28509 __tmp.len()
28510 }
28511 }
28512}
28513#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F17 format."]
28514#[doc = ""]
28515#[doc = "ID: 183"]
28516#[derive(Debug, Clone, PartialEq)]
28517#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28518#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28519#[cfg_attr(feature = "ts", derive(TS))]
28520#[cfg_attr(feature = "ts", ts(export))]
28521pub struct SERIAL_UDB_EXTRA_F17_DATA {
28522 #[doc = "SUE Feed Forward Gain"]
28523 pub sue_feed_forward: f32,
28524 #[doc = "SUE Max Turn Rate when Navigating"]
28525 pub sue_turn_rate_nav: f32,
28526 #[doc = "SUE Max Turn Rate in Fly By Wire Mode"]
28527 pub sue_turn_rate_fbw: f32,
28528}
28529impl SERIAL_UDB_EXTRA_F17_DATA {
28530 pub const ENCODED_LEN: usize = 12usize;
28531 pub const DEFAULT: Self = Self {
28532 sue_feed_forward: 0.0_f32,
28533 sue_turn_rate_nav: 0.0_f32,
28534 sue_turn_rate_fbw: 0.0_f32,
28535 };
28536 #[cfg(feature = "arbitrary")]
28537 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28538 use arbitrary::{Arbitrary, Unstructured};
28539 let mut buf = [0u8; 1024];
28540 rng.fill_bytes(&mut buf);
28541 let mut unstructured = Unstructured::new(&buf);
28542 Self::arbitrary(&mut unstructured).unwrap_or_default()
28543 }
28544}
28545impl Default for SERIAL_UDB_EXTRA_F17_DATA {
28546 fn default() -> Self {
28547 Self::DEFAULT.clone()
28548 }
28549}
28550impl MessageData for SERIAL_UDB_EXTRA_F17_DATA {
28551 type Message = MavMessage;
28552 const ID: u32 = 183u32;
28553 const NAME: &'static str = "SERIAL_UDB_EXTRA_F17";
28554 const EXTRA_CRC: u8 = 175u8;
28555 const ENCODED_LEN: usize = 12usize;
28556 fn deser(
28557 _version: MavlinkVersion,
28558 __input: &[u8],
28559 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28560 let avail_len = __input.len();
28561 let mut payload_buf = [0; Self::ENCODED_LEN];
28562 let mut buf = if avail_len < Self::ENCODED_LEN {
28563 payload_buf[0..avail_len].copy_from_slice(__input);
28564 Bytes::new(&payload_buf)
28565 } else {
28566 Bytes::new(__input)
28567 };
28568 let mut __struct = Self::default();
28569 __struct.sue_feed_forward = buf.get_f32_le()?;
28570 __struct.sue_turn_rate_nav = buf.get_f32_le()?;
28571 __struct.sue_turn_rate_fbw = buf.get_f32_le()?;
28572 Ok(__struct)
28573 }
28574 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28575 let mut __tmp = BytesMut::new(bytes);
28576 #[allow(clippy::absurd_extreme_comparisons)]
28577 #[allow(unused_comparisons)]
28578 if __tmp.remaining() < Self::ENCODED_LEN {
28579 panic!(
28580 "buffer is too small (need {} bytes, but got {})",
28581 Self::ENCODED_LEN,
28582 __tmp.remaining(),
28583 )
28584 }
28585 __tmp.put_f32_le(self.sue_feed_forward);
28586 __tmp.put_f32_le(self.sue_turn_rate_nav);
28587 __tmp.put_f32_le(self.sue_turn_rate_fbw);
28588 if matches!(version, MavlinkVersion::V2) {
28589 let len = __tmp.len();
28590 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28591 } else {
28592 __tmp.len()
28593 }
28594 }
28595}
28596#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F18 format."]
28597#[doc = ""]
28598#[doc = "ID: 184"]
28599#[derive(Debug, Clone, PartialEq)]
28600#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28601#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28602#[cfg_attr(feature = "ts", derive(TS))]
28603#[cfg_attr(feature = "ts", ts(export))]
28604pub struct SERIAL_UDB_EXTRA_F18_DATA {
28605 #[doc = "SUE Angle of Attack Normal"]
28606 pub angle_of_attack_normal: f32,
28607 #[doc = "SUE Angle of Attack Inverted"]
28608 pub angle_of_attack_inverted: f32,
28609 #[doc = "SUE Elevator Trim Normal"]
28610 pub elevator_trim_normal: f32,
28611 #[doc = "SUE Elevator Trim Inverted"]
28612 pub elevator_trim_inverted: f32,
28613 #[doc = "SUE reference_speed"]
28614 pub reference_speed: f32,
28615}
28616impl SERIAL_UDB_EXTRA_F18_DATA {
28617 pub const ENCODED_LEN: usize = 20usize;
28618 pub const DEFAULT: Self = Self {
28619 angle_of_attack_normal: 0.0_f32,
28620 angle_of_attack_inverted: 0.0_f32,
28621 elevator_trim_normal: 0.0_f32,
28622 elevator_trim_inverted: 0.0_f32,
28623 reference_speed: 0.0_f32,
28624 };
28625 #[cfg(feature = "arbitrary")]
28626 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28627 use arbitrary::{Arbitrary, Unstructured};
28628 let mut buf = [0u8; 1024];
28629 rng.fill_bytes(&mut buf);
28630 let mut unstructured = Unstructured::new(&buf);
28631 Self::arbitrary(&mut unstructured).unwrap_or_default()
28632 }
28633}
28634impl Default for SERIAL_UDB_EXTRA_F18_DATA {
28635 fn default() -> Self {
28636 Self::DEFAULT.clone()
28637 }
28638}
28639impl MessageData for SERIAL_UDB_EXTRA_F18_DATA {
28640 type Message = MavMessage;
28641 const ID: u32 = 184u32;
28642 const NAME: &'static str = "SERIAL_UDB_EXTRA_F18";
28643 const EXTRA_CRC: u8 = 41u8;
28644 const ENCODED_LEN: usize = 20usize;
28645 fn deser(
28646 _version: MavlinkVersion,
28647 __input: &[u8],
28648 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28649 let avail_len = __input.len();
28650 let mut payload_buf = [0; Self::ENCODED_LEN];
28651 let mut buf = if avail_len < Self::ENCODED_LEN {
28652 payload_buf[0..avail_len].copy_from_slice(__input);
28653 Bytes::new(&payload_buf)
28654 } else {
28655 Bytes::new(__input)
28656 };
28657 let mut __struct = Self::default();
28658 __struct.angle_of_attack_normal = buf.get_f32_le()?;
28659 __struct.angle_of_attack_inverted = buf.get_f32_le()?;
28660 __struct.elevator_trim_normal = buf.get_f32_le()?;
28661 __struct.elevator_trim_inverted = buf.get_f32_le()?;
28662 __struct.reference_speed = buf.get_f32_le()?;
28663 Ok(__struct)
28664 }
28665 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28666 let mut __tmp = BytesMut::new(bytes);
28667 #[allow(clippy::absurd_extreme_comparisons)]
28668 #[allow(unused_comparisons)]
28669 if __tmp.remaining() < Self::ENCODED_LEN {
28670 panic!(
28671 "buffer is too small (need {} bytes, but got {})",
28672 Self::ENCODED_LEN,
28673 __tmp.remaining(),
28674 )
28675 }
28676 __tmp.put_f32_le(self.angle_of_attack_normal);
28677 __tmp.put_f32_le(self.angle_of_attack_inverted);
28678 __tmp.put_f32_le(self.elevator_trim_normal);
28679 __tmp.put_f32_le(self.elevator_trim_inverted);
28680 __tmp.put_f32_le(self.reference_speed);
28681 if matches!(version, MavlinkVersion::V2) {
28682 let len = __tmp.len();
28683 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28684 } else {
28685 __tmp.len()
28686 }
28687 }
28688}
28689#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F19 format."]
28690#[doc = ""]
28691#[doc = "ID: 185"]
28692#[derive(Debug, Clone, PartialEq)]
28693#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28694#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28695#[cfg_attr(feature = "ts", derive(TS))]
28696#[cfg_attr(feature = "ts", ts(export))]
28697pub struct SERIAL_UDB_EXTRA_F19_DATA {
28698 #[doc = "SUE aileron output channel"]
28699 pub sue_aileron_output_channel: u8,
28700 #[doc = "SUE aileron reversed"]
28701 pub sue_aileron_reversed: u8,
28702 #[doc = "SUE elevator output channel"]
28703 pub sue_elevator_output_channel: u8,
28704 #[doc = "SUE elevator reversed"]
28705 pub sue_elevator_reversed: u8,
28706 #[doc = "SUE throttle output channel"]
28707 pub sue_throttle_output_channel: u8,
28708 #[doc = "SUE throttle reversed"]
28709 pub sue_throttle_reversed: u8,
28710 #[doc = "SUE rudder output channel"]
28711 pub sue_rudder_output_channel: u8,
28712 #[doc = "SUE rudder reversed"]
28713 pub sue_rudder_reversed: u8,
28714}
28715impl SERIAL_UDB_EXTRA_F19_DATA {
28716 pub const ENCODED_LEN: usize = 8usize;
28717 pub const DEFAULT: Self = Self {
28718 sue_aileron_output_channel: 0_u8,
28719 sue_aileron_reversed: 0_u8,
28720 sue_elevator_output_channel: 0_u8,
28721 sue_elevator_reversed: 0_u8,
28722 sue_throttle_output_channel: 0_u8,
28723 sue_throttle_reversed: 0_u8,
28724 sue_rudder_output_channel: 0_u8,
28725 sue_rudder_reversed: 0_u8,
28726 };
28727 #[cfg(feature = "arbitrary")]
28728 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28729 use arbitrary::{Arbitrary, Unstructured};
28730 let mut buf = [0u8; 1024];
28731 rng.fill_bytes(&mut buf);
28732 let mut unstructured = Unstructured::new(&buf);
28733 Self::arbitrary(&mut unstructured).unwrap_or_default()
28734 }
28735}
28736impl Default for SERIAL_UDB_EXTRA_F19_DATA {
28737 fn default() -> Self {
28738 Self::DEFAULT.clone()
28739 }
28740}
28741impl MessageData for SERIAL_UDB_EXTRA_F19_DATA {
28742 type Message = MavMessage;
28743 const ID: u32 = 185u32;
28744 const NAME: &'static str = "SERIAL_UDB_EXTRA_F19";
28745 const EXTRA_CRC: u8 = 87u8;
28746 const ENCODED_LEN: usize = 8usize;
28747 fn deser(
28748 _version: MavlinkVersion,
28749 __input: &[u8],
28750 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28751 let avail_len = __input.len();
28752 let mut payload_buf = [0; Self::ENCODED_LEN];
28753 let mut buf = if avail_len < Self::ENCODED_LEN {
28754 payload_buf[0..avail_len].copy_from_slice(__input);
28755 Bytes::new(&payload_buf)
28756 } else {
28757 Bytes::new(__input)
28758 };
28759 let mut __struct = Self::default();
28760 __struct.sue_aileron_output_channel = buf.get_u8()?;
28761 __struct.sue_aileron_reversed = buf.get_u8()?;
28762 __struct.sue_elevator_output_channel = buf.get_u8()?;
28763 __struct.sue_elevator_reversed = buf.get_u8()?;
28764 __struct.sue_throttle_output_channel = buf.get_u8()?;
28765 __struct.sue_throttle_reversed = buf.get_u8()?;
28766 __struct.sue_rudder_output_channel = buf.get_u8()?;
28767 __struct.sue_rudder_reversed = buf.get_u8()?;
28768 Ok(__struct)
28769 }
28770 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28771 let mut __tmp = BytesMut::new(bytes);
28772 #[allow(clippy::absurd_extreme_comparisons)]
28773 #[allow(unused_comparisons)]
28774 if __tmp.remaining() < Self::ENCODED_LEN {
28775 panic!(
28776 "buffer is too small (need {} bytes, but got {})",
28777 Self::ENCODED_LEN,
28778 __tmp.remaining(),
28779 )
28780 }
28781 __tmp.put_u8(self.sue_aileron_output_channel);
28782 __tmp.put_u8(self.sue_aileron_reversed);
28783 __tmp.put_u8(self.sue_elevator_output_channel);
28784 __tmp.put_u8(self.sue_elevator_reversed);
28785 __tmp.put_u8(self.sue_throttle_output_channel);
28786 __tmp.put_u8(self.sue_throttle_reversed);
28787 __tmp.put_u8(self.sue_rudder_output_channel);
28788 __tmp.put_u8(self.sue_rudder_reversed);
28789 if matches!(version, MavlinkVersion::V2) {
28790 let len = __tmp.len();
28791 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28792 } else {
28793 __tmp.len()
28794 }
28795 }
28796}
28797#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F20 format."]
28798#[doc = ""]
28799#[doc = "ID: 186"]
28800#[derive(Debug, Clone, PartialEq)]
28801#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28802#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28803#[cfg_attr(feature = "ts", derive(TS))]
28804#[cfg_attr(feature = "ts", ts(export))]
28805pub struct SERIAL_UDB_EXTRA_F20_DATA {
28806 #[doc = "SUE UDB PWM Trim Value on Input 1"]
28807 pub sue_trim_value_input_1: i16,
28808 #[doc = "SUE UDB PWM Trim Value on Input 2"]
28809 pub sue_trim_value_input_2: i16,
28810 #[doc = "SUE UDB PWM Trim Value on Input 3"]
28811 pub sue_trim_value_input_3: i16,
28812 #[doc = "SUE UDB PWM Trim Value on Input 4"]
28813 pub sue_trim_value_input_4: i16,
28814 #[doc = "SUE UDB PWM Trim Value on Input 5"]
28815 pub sue_trim_value_input_5: i16,
28816 #[doc = "SUE UDB PWM Trim Value on Input 6"]
28817 pub sue_trim_value_input_6: i16,
28818 #[doc = "SUE UDB PWM Trim Value on Input 7"]
28819 pub sue_trim_value_input_7: i16,
28820 #[doc = "SUE UDB PWM Trim Value on Input 8"]
28821 pub sue_trim_value_input_8: i16,
28822 #[doc = "SUE UDB PWM Trim Value on Input 9"]
28823 pub sue_trim_value_input_9: i16,
28824 #[doc = "SUE UDB PWM Trim Value on Input 10"]
28825 pub sue_trim_value_input_10: i16,
28826 #[doc = "SUE UDB PWM Trim Value on Input 11"]
28827 pub sue_trim_value_input_11: i16,
28828 #[doc = "SUE UDB PWM Trim Value on Input 12"]
28829 pub sue_trim_value_input_12: i16,
28830 #[doc = "SUE Number of Input Channels"]
28831 pub sue_number_of_inputs: u8,
28832}
28833impl SERIAL_UDB_EXTRA_F20_DATA {
28834 pub const ENCODED_LEN: usize = 25usize;
28835 pub const DEFAULT: Self = Self {
28836 sue_trim_value_input_1: 0_i16,
28837 sue_trim_value_input_2: 0_i16,
28838 sue_trim_value_input_3: 0_i16,
28839 sue_trim_value_input_4: 0_i16,
28840 sue_trim_value_input_5: 0_i16,
28841 sue_trim_value_input_6: 0_i16,
28842 sue_trim_value_input_7: 0_i16,
28843 sue_trim_value_input_8: 0_i16,
28844 sue_trim_value_input_9: 0_i16,
28845 sue_trim_value_input_10: 0_i16,
28846 sue_trim_value_input_11: 0_i16,
28847 sue_trim_value_input_12: 0_i16,
28848 sue_number_of_inputs: 0_u8,
28849 };
28850 #[cfg(feature = "arbitrary")]
28851 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28852 use arbitrary::{Arbitrary, Unstructured};
28853 let mut buf = [0u8; 1024];
28854 rng.fill_bytes(&mut buf);
28855 let mut unstructured = Unstructured::new(&buf);
28856 Self::arbitrary(&mut unstructured).unwrap_or_default()
28857 }
28858}
28859impl Default for SERIAL_UDB_EXTRA_F20_DATA {
28860 fn default() -> Self {
28861 Self::DEFAULT.clone()
28862 }
28863}
28864impl MessageData for SERIAL_UDB_EXTRA_F20_DATA {
28865 type Message = MavMessage;
28866 const ID: u32 = 186u32;
28867 const NAME: &'static str = "SERIAL_UDB_EXTRA_F20";
28868 const EXTRA_CRC: u8 = 144u8;
28869 const ENCODED_LEN: usize = 25usize;
28870 fn deser(
28871 _version: MavlinkVersion,
28872 __input: &[u8],
28873 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28874 let avail_len = __input.len();
28875 let mut payload_buf = [0; Self::ENCODED_LEN];
28876 let mut buf = if avail_len < Self::ENCODED_LEN {
28877 payload_buf[0..avail_len].copy_from_slice(__input);
28878 Bytes::new(&payload_buf)
28879 } else {
28880 Bytes::new(__input)
28881 };
28882 let mut __struct = Self::default();
28883 __struct.sue_trim_value_input_1 = buf.get_i16_le()?;
28884 __struct.sue_trim_value_input_2 = buf.get_i16_le()?;
28885 __struct.sue_trim_value_input_3 = buf.get_i16_le()?;
28886 __struct.sue_trim_value_input_4 = buf.get_i16_le()?;
28887 __struct.sue_trim_value_input_5 = buf.get_i16_le()?;
28888 __struct.sue_trim_value_input_6 = buf.get_i16_le()?;
28889 __struct.sue_trim_value_input_7 = buf.get_i16_le()?;
28890 __struct.sue_trim_value_input_8 = buf.get_i16_le()?;
28891 __struct.sue_trim_value_input_9 = buf.get_i16_le()?;
28892 __struct.sue_trim_value_input_10 = buf.get_i16_le()?;
28893 __struct.sue_trim_value_input_11 = buf.get_i16_le()?;
28894 __struct.sue_trim_value_input_12 = buf.get_i16_le()?;
28895 __struct.sue_number_of_inputs = buf.get_u8()?;
28896 Ok(__struct)
28897 }
28898 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28899 let mut __tmp = BytesMut::new(bytes);
28900 #[allow(clippy::absurd_extreme_comparisons)]
28901 #[allow(unused_comparisons)]
28902 if __tmp.remaining() < Self::ENCODED_LEN {
28903 panic!(
28904 "buffer is too small (need {} bytes, but got {})",
28905 Self::ENCODED_LEN,
28906 __tmp.remaining(),
28907 )
28908 }
28909 __tmp.put_i16_le(self.sue_trim_value_input_1);
28910 __tmp.put_i16_le(self.sue_trim_value_input_2);
28911 __tmp.put_i16_le(self.sue_trim_value_input_3);
28912 __tmp.put_i16_le(self.sue_trim_value_input_4);
28913 __tmp.put_i16_le(self.sue_trim_value_input_5);
28914 __tmp.put_i16_le(self.sue_trim_value_input_6);
28915 __tmp.put_i16_le(self.sue_trim_value_input_7);
28916 __tmp.put_i16_le(self.sue_trim_value_input_8);
28917 __tmp.put_i16_le(self.sue_trim_value_input_9);
28918 __tmp.put_i16_le(self.sue_trim_value_input_10);
28919 __tmp.put_i16_le(self.sue_trim_value_input_11);
28920 __tmp.put_i16_le(self.sue_trim_value_input_12);
28921 __tmp.put_u8(self.sue_number_of_inputs);
28922 if matches!(version, MavlinkVersion::V2) {
28923 let len = __tmp.len();
28924 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28925 } else {
28926 __tmp.len()
28927 }
28928 }
28929}
28930#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F21 format."]
28931#[doc = ""]
28932#[doc = "ID: 187"]
28933#[derive(Debug, Clone, PartialEq)]
28934#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28935#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28936#[cfg_attr(feature = "ts", derive(TS))]
28937#[cfg_attr(feature = "ts", ts(export))]
28938pub struct SERIAL_UDB_EXTRA_F21_DATA {
28939 #[doc = "SUE X accelerometer offset"]
28940 pub sue_accel_x_offset: i16,
28941 #[doc = "SUE Y accelerometer offset"]
28942 pub sue_accel_y_offset: i16,
28943 #[doc = "SUE Z accelerometer offset"]
28944 pub sue_accel_z_offset: i16,
28945 #[doc = "SUE X gyro offset"]
28946 pub sue_gyro_x_offset: i16,
28947 #[doc = "SUE Y gyro offset"]
28948 pub sue_gyro_y_offset: i16,
28949 #[doc = "SUE Z gyro offset"]
28950 pub sue_gyro_z_offset: i16,
28951}
28952impl SERIAL_UDB_EXTRA_F21_DATA {
28953 pub const ENCODED_LEN: usize = 12usize;
28954 pub const DEFAULT: Self = Self {
28955 sue_accel_x_offset: 0_i16,
28956 sue_accel_y_offset: 0_i16,
28957 sue_accel_z_offset: 0_i16,
28958 sue_gyro_x_offset: 0_i16,
28959 sue_gyro_y_offset: 0_i16,
28960 sue_gyro_z_offset: 0_i16,
28961 };
28962 #[cfg(feature = "arbitrary")]
28963 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28964 use arbitrary::{Arbitrary, Unstructured};
28965 let mut buf = [0u8; 1024];
28966 rng.fill_bytes(&mut buf);
28967 let mut unstructured = Unstructured::new(&buf);
28968 Self::arbitrary(&mut unstructured).unwrap_or_default()
28969 }
28970}
28971impl Default for SERIAL_UDB_EXTRA_F21_DATA {
28972 fn default() -> Self {
28973 Self::DEFAULT.clone()
28974 }
28975}
28976impl MessageData for SERIAL_UDB_EXTRA_F21_DATA {
28977 type Message = MavMessage;
28978 const ID: u32 = 187u32;
28979 const NAME: &'static str = "SERIAL_UDB_EXTRA_F21";
28980 const EXTRA_CRC: u8 = 134u8;
28981 const ENCODED_LEN: usize = 12usize;
28982 fn deser(
28983 _version: MavlinkVersion,
28984 __input: &[u8],
28985 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28986 let avail_len = __input.len();
28987 let mut payload_buf = [0; Self::ENCODED_LEN];
28988 let mut buf = if avail_len < Self::ENCODED_LEN {
28989 payload_buf[0..avail_len].copy_from_slice(__input);
28990 Bytes::new(&payload_buf)
28991 } else {
28992 Bytes::new(__input)
28993 };
28994 let mut __struct = Self::default();
28995 __struct.sue_accel_x_offset = buf.get_i16_le()?;
28996 __struct.sue_accel_y_offset = buf.get_i16_le()?;
28997 __struct.sue_accel_z_offset = buf.get_i16_le()?;
28998 __struct.sue_gyro_x_offset = buf.get_i16_le()?;
28999 __struct.sue_gyro_y_offset = buf.get_i16_le()?;
29000 __struct.sue_gyro_z_offset = buf.get_i16_le()?;
29001 Ok(__struct)
29002 }
29003 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29004 let mut __tmp = BytesMut::new(bytes);
29005 #[allow(clippy::absurd_extreme_comparisons)]
29006 #[allow(unused_comparisons)]
29007 if __tmp.remaining() < Self::ENCODED_LEN {
29008 panic!(
29009 "buffer is too small (need {} bytes, but got {})",
29010 Self::ENCODED_LEN,
29011 __tmp.remaining(),
29012 )
29013 }
29014 __tmp.put_i16_le(self.sue_accel_x_offset);
29015 __tmp.put_i16_le(self.sue_accel_y_offset);
29016 __tmp.put_i16_le(self.sue_accel_z_offset);
29017 __tmp.put_i16_le(self.sue_gyro_x_offset);
29018 __tmp.put_i16_le(self.sue_gyro_y_offset);
29019 __tmp.put_i16_le(self.sue_gyro_z_offset);
29020 if matches!(version, MavlinkVersion::V2) {
29021 let len = __tmp.len();
29022 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29023 } else {
29024 __tmp.len()
29025 }
29026 }
29027}
29028#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F22 format."]
29029#[doc = ""]
29030#[doc = "ID: 188"]
29031#[derive(Debug, Clone, PartialEq)]
29032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29033#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29034#[cfg_attr(feature = "ts", derive(TS))]
29035#[cfg_attr(feature = "ts", ts(export))]
29036pub struct SERIAL_UDB_EXTRA_F22_DATA {
29037 #[doc = "SUE X accelerometer at calibration time"]
29038 pub sue_accel_x_at_calibration: i16,
29039 #[doc = "SUE Y accelerometer at calibration time"]
29040 pub sue_accel_y_at_calibration: i16,
29041 #[doc = "SUE Z accelerometer at calibration time"]
29042 pub sue_accel_z_at_calibration: i16,
29043 #[doc = "SUE X gyro at calibration time"]
29044 pub sue_gyro_x_at_calibration: i16,
29045 #[doc = "SUE Y gyro at calibration time"]
29046 pub sue_gyro_y_at_calibration: i16,
29047 #[doc = "SUE Z gyro at calibration time"]
29048 pub sue_gyro_z_at_calibration: i16,
29049}
29050impl SERIAL_UDB_EXTRA_F22_DATA {
29051 pub const ENCODED_LEN: usize = 12usize;
29052 pub const DEFAULT: Self = Self {
29053 sue_accel_x_at_calibration: 0_i16,
29054 sue_accel_y_at_calibration: 0_i16,
29055 sue_accel_z_at_calibration: 0_i16,
29056 sue_gyro_x_at_calibration: 0_i16,
29057 sue_gyro_y_at_calibration: 0_i16,
29058 sue_gyro_z_at_calibration: 0_i16,
29059 };
29060 #[cfg(feature = "arbitrary")]
29061 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29062 use arbitrary::{Arbitrary, Unstructured};
29063 let mut buf = [0u8; 1024];
29064 rng.fill_bytes(&mut buf);
29065 let mut unstructured = Unstructured::new(&buf);
29066 Self::arbitrary(&mut unstructured).unwrap_or_default()
29067 }
29068}
29069impl Default for SERIAL_UDB_EXTRA_F22_DATA {
29070 fn default() -> Self {
29071 Self::DEFAULT.clone()
29072 }
29073}
29074impl MessageData for SERIAL_UDB_EXTRA_F22_DATA {
29075 type Message = MavMessage;
29076 const ID: u32 = 188u32;
29077 const NAME: &'static str = "SERIAL_UDB_EXTRA_F22";
29078 const EXTRA_CRC: u8 = 91u8;
29079 const ENCODED_LEN: usize = 12usize;
29080 fn deser(
29081 _version: MavlinkVersion,
29082 __input: &[u8],
29083 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29084 let avail_len = __input.len();
29085 let mut payload_buf = [0; Self::ENCODED_LEN];
29086 let mut buf = if avail_len < Self::ENCODED_LEN {
29087 payload_buf[0..avail_len].copy_from_slice(__input);
29088 Bytes::new(&payload_buf)
29089 } else {
29090 Bytes::new(__input)
29091 };
29092 let mut __struct = Self::default();
29093 __struct.sue_accel_x_at_calibration = buf.get_i16_le()?;
29094 __struct.sue_accel_y_at_calibration = buf.get_i16_le()?;
29095 __struct.sue_accel_z_at_calibration = buf.get_i16_le()?;
29096 __struct.sue_gyro_x_at_calibration = buf.get_i16_le()?;
29097 __struct.sue_gyro_y_at_calibration = buf.get_i16_le()?;
29098 __struct.sue_gyro_z_at_calibration = buf.get_i16_le()?;
29099 Ok(__struct)
29100 }
29101 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29102 let mut __tmp = BytesMut::new(bytes);
29103 #[allow(clippy::absurd_extreme_comparisons)]
29104 #[allow(unused_comparisons)]
29105 if __tmp.remaining() < Self::ENCODED_LEN {
29106 panic!(
29107 "buffer is too small (need {} bytes, but got {})",
29108 Self::ENCODED_LEN,
29109 __tmp.remaining(),
29110 )
29111 }
29112 __tmp.put_i16_le(self.sue_accel_x_at_calibration);
29113 __tmp.put_i16_le(self.sue_accel_y_at_calibration);
29114 __tmp.put_i16_le(self.sue_accel_z_at_calibration);
29115 __tmp.put_i16_le(self.sue_gyro_x_at_calibration);
29116 __tmp.put_i16_le(self.sue_gyro_y_at_calibration);
29117 __tmp.put_i16_le(self.sue_gyro_z_at_calibration);
29118 if matches!(version, MavlinkVersion::V2) {
29119 let len = __tmp.len();
29120 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29121 } else {
29122 __tmp.len()
29123 }
29124 }
29125}
29126#[doc = "Backwards compatible MAVLink version of SERIAL_UDB_EXTRA - F2: Format Part A."]
29127#[doc = ""]
29128#[doc = "ID: 170"]
29129#[derive(Debug, Clone, PartialEq)]
29130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29131#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29132#[cfg_attr(feature = "ts", derive(TS))]
29133#[cfg_attr(feature = "ts", ts(export))]
29134pub struct SERIAL_UDB_EXTRA_F2_A_DATA {
29135 #[doc = "Serial UDB Extra Time"]
29136 pub sue_time: u32,
29137 #[doc = "Serial UDB Extra Latitude"]
29138 pub sue_latitude: i32,
29139 #[doc = "Serial UDB Extra Longitude"]
29140 pub sue_longitude: i32,
29141 #[doc = "Serial UDB Extra Altitude"]
29142 pub sue_altitude: i32,
29143 #[doc = "Serial UDB Extra Waypoint Index"]
29144 pub sue_waypoint_index: u16,
29145 #[doc = "Serial UDB Extra Rmat 0"]
29146 pub sue_rmat0: i16,
29147 #[doc = "Serial UDB Extra Rmat 1"]
29148 pub sue_rmat1: i16,
29149 #[doc = "Serial UDB Extra Rmat 2"]
29150 pub sue_rmat2: i16,
29151 #[doc = "Serial UDB Extra Rmat 3"]
29152 pub sue_rmat3: i16,
29153 #[doc = "Serial UDB Extra Rmat 4"]
29154 pub sue_rmat4: i16,
29155 #[doc = "Serial UDB Extra Rmat 5"]
29156 pub sue_rmat5: i16,
29157 #[doc = "Serial UDB Extra Rmat 6"]
29158 pub sue_rmat6: i16,
29159 #[doc = "Serial UDB Extra Rmat 7"]
29160 pub sue_rmat7: i16,
29161 #[doc = "Serial UDB Extra Rmat 8"]
29162 pub sue_rmat8: i16,
29163 #[doc = "Serial UDB Extra GPS Course Over Ground"]
29164 pub sue_cog: u16,
29165 #[doc = "Serial UDB Extra Speed Over Ground"]
29166 pub sue_sog: i16,
29167 #[doc = "Serial UDB Extra CPU Load"]
29168 pub sue_cpu_load: u16,
29169 #[doc = "Serial UDB Extra 3D IMU Air Speed"]
29170 pub sue_air_speed_3DIMU: u16,
29171 #[doc = "Serial UDB Extra Estimated Wind 0"]
29172 pub sue_estimated_wind_0: i16,
29173 #[doc = "Serial UDB Extra Estimated Wind 1"]
29174 pub sue_estimated_wind_1: i16,
29175 #[doc = "Serial UDB Extra Estimated Wind 2"]
29176 pub sue_estimated_wind_2: i16,
29177 #[doc = "Serial UDB Extra Magnetic Field Earth 0"]
29178 pub sue_magFieldEarth0: i16,
29179 #[doc = "Serial UDB Extra Magnetic Field Earth 1"]
29180 pub sue_magFieldEarth1: i16,
29181 #[doc = "Serial UDB Extra Magnetic Field Earth 2"]
29182 pub sue_magFieldEarth2: i16,
29183 #[doc = "Serial UDB Extra Number of Satellites in View"]
29184 pub sue_svs: i16,
29185 #[doc = "Serial UDB Extra GPS Horizontal Dilution of Precision"]
29186 pub sue_hdop: i16,
29187 #[doc = "Serial UDB Extra Status"]
29188 pub sue_status: u8,
29189}
29190impl SERIAL_UDB_EXTRA_F2_A_DATA {
29191 pub const ENCODED_LEN: usize = 61usize;
29192 pub const DEFAULT: Self = Self {
29193 sue_time: 0_u32,
29194 sue_latitude: 0_i32,
29195 sue_longitude: 0_i32,
29196 sue_altitude: 0_i32,
29197 sue_waypoint_index: 0_u16,
29198 sue_rmat0: 0_i16,
29199 sue_rmat1: 0_i16,
29200 sue_rmat2: 0_i16,
29201 sue_rmat3: 0_i16,
29202 sue_rmat4: 0_i16,
29203 sue_rmat5: 0_i16,
29204 sue_rmat6: 0_i16,
29205 sue_rmat7: 0_i16,
29206 sue_rmat8: 0_i16,
29207 sue_cog: 0_u16,
29208 sue_sog: 0_i16,
29209 sue_cpu_load: 0_u16,
29210 sue_air_speed_3DIMU: 0_u16,
29211 sue_estimated_wind_0: 0_i16,
29212 sue_estimated_wind_1: 0_i16,
29213 sue_estimated_wind_2: 0_i16,
29214 sue_magFieldEarth0: 0_i16,
29215 sue_magFieldEarth1: 0_i16,
29216 sue_magFieldEarth2: 0_i16,
29217 sue_svs: 0_i16,
29218 sue_hdop: 0_i16,
29219 sue_status: 0_u8,
29220 };
29221 #[cfg(feature = "arbitrary")]
29222 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29223 use arbitrary::{Arbitrary, Unstructured};
29224 let mut buf = [0u8; 1024];
29225 rng.fill_bytes(&mut buf);
29226 let mut unstructured = Unstructured::new(&buf);
29227 Self::arbitrary(&mut unstructured).unwrap_or_default()
29228 }
29229}
29230impl Default for SERIAL_UDB_EXTRA_F2_A_DATA {
29231 fn default() -> Self {
29232 Self::DEFAULT.clone()
29233 }
29234}
29235impl MessageData for SERIAL_UDB_EXTRA_F2_A_DATA {
29236 type Message = MavMessage;
29237 const ID: u32 = 170u32;
29238 const NAME: &'static str = "SERIAL_UDB_EXTRA_F2_A";
29239 const EXTRA_CRC: u8 = 103u8;
29240 const ENCODED_LEN: usize = 61usize;
29241 fn deser(
29242 _version: MavlinkVersion,
29243 __input: &[u8],
29244 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29245 let avail_len = __input.len();
29246 let mut payload_buf = [0; Self::ENCODED_LEN];
29247 let mut buf = if avail_len < Self::ENCODED_LEN {
29248 payload_buf[0..avail_len].copy_from_slice(__input);
29249 Bytes::new(&payload_buf)
29250 } else {
29251 Bytes::new(__input)
29252 };
29253 let mut __struct = Self::default();
29254 __struct.sue_time = buf.get_u32_le()?;
29255 __struct.sue_latitude = buf.get_i32_le()?;
29256 __struct.sue_longitude = buf.get_i32_le()?;
29257 __struct.sue_altitude = buf.get_i32_le()?;
29258 __struct.sue_waypoint_index = buf.get_u16_le()?;
29259 __struct.sue_rmat0 = buf.get_i16_le()?;
29260 __struct.sue_rmat1 = buf.get_i16_le()?;
29261 __struct.sue_rmat2 = buf.get_i16_le()?;
29262 __struct.sue_rmat3 = buf.get_i16_le()?;
29263 __struct.sue_rmat4 = buf.get_i16_le()?;
29264 __struct.sue_rmat5 = buf.get_i16_le()?;
29265 __struct.sue_rmat6 = buf.get_i16_le()?;
29266 __struct.sue_rmat7 = buf.get_i16_le()?;
29267 __struct.sue_rmat8 = buf.get_i16_le()?;
29268 __struct.sue_cog = buf.get_u16_le()?;
29269 __struct.sue_sog = buf.get_i16_le()?;
29270 __struct.sue_cpu_load = buf.get_u16_le()?;
29271 __struct.sue_air_speed_3DIMU = buf.get_u16_le()?;
29272 __struct.sue_estimated_wind_0 = buf.get_i16_le()?;
29273 __struct.sue_estimated_wind_1 = buf.get_i16_le()?;
29274 __struct.sue_estimated_wind_2 = buf.get_i16_le()?;
29275 __struct.sue_magFieldEarth0 = buf.get_i16_le()?;
29276 __struct.sue_magFieldEarth1 = buf.get_i16_le()?;
29277 __struct.sue_magFieldEarth2 = buf.get_i16_le()?;
29278 __struct.sue_svs = buf.get_i16_le()?;
29279 __struct.sue_hdop = buf.get_i16_le()?;
29280 __struct.sue_status = buf.get_u8()?;
29281 Ok(__struct)
29282 }
29283 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29284 let mut __tmp = BytesMut::new(bytes);
29285 #[allow(clippy::absurd_extreme_comparisons)]
29286 #[allow(unused_comparisons)]
29287 if __tmp.remaining() < Self::ENCODED_LEN {
29288 panic!(
29289 "buffer is too small (need {} bytes, but got {})",
29290 Self::ENCODED_LEN,
29291 __tmp.remaining(),
29292 )
29293 }
29294 __tmp.put_u32_le(self.sue_time);
29295 __tmp.put_i32_le(self.sue_latitude);
29296 __tmp.put_i32_le(self.sue_longitude);
29297 __tmp.put_i32_le(self.sue_altitude);
29298 __tmp.put_u16_le(self.sue_waypoint_index);
29299 __tmp.put_i16_le(self.sue_rmat0);
29300 __tmp.put_i16_le(self.sue_rmat1);
29301 __tmp.put_i16_le(self.sue_rmat2);
29302 __tmp.put_i16_le(self.sue_rmat3);
29303 __tmp.put_i16_le(self.sue_rmat4);
29304 __tmp.put_i16_le(self.sue_rmat5);
29305 __tmp.put_i16_le(self.sue_rmat6);
29306 __tmp.put_i16_le(self.sue_rmat7);
29307 __tmp.put_i16_le(self.sue_rmat8);
29308 __tmp.put_u16_le(self.sue_cog);
29309 __tmp.put_i16_le(self.sue_sog);
29310 __tmp.put_u16_le(self.sue_cpu_load);
29311 __tmp.put_u16_le(self.sue_air_speed_3DIMU);
29312 __tmp.put_i16_le(self.sue_estimated_wind_0);
29313 __tmp.put_i16_le(self.sue_estimated_wind_1);
29314 __tmp.put_i16_le(self.sue_estimated_wind_2);
29315 __tmp.put_i16_le(self.sue_magFieldEarth0);
29316 __tmp.put_i16_le(self.sue_magFieldEarth1);
29317 __tmp.put_i16_le(self.sue_magFieldEarth2);
29318 __tmp.put_i16_le(self.sue_svs);
29319 __tmp.put_i16_le(self.sue_hdop);
29320 __tmp.put_u8(self.sue_status);
29321 if matches!(version, MavlinkVersion::V2) {
29322 let len = __tmp.len();
29323 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29324 } else {
29325 __tmp.len()
29326 }
29327 }
29328}
29329#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA - F2: Part B."]
29330#[doc = ""]
29331#[doc = "ID: 171"]
29332#[derive(Debug, Clone, PartialEq)]
29333#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29334#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29335#[cfg_attr(feature = "ts", derive(TS))]
29336#[cfg_attr(feature = "ts", ts(export))]
29337pub struct SERIAL_UDB_EXTRA_F2_B_DATA {
29338 #[doc = "Serial UDB Extra Time"]
29339 pub sue_time: u32,
29340 #[doc = "Serial UDB Extra Status Flags"]
29341 pub sue_flags: u32,
29342 #[doc = "SUE barometer pressure"]
29343 pub sue_barom_press: i32,
29344 #[doc = "SUE barometer altitude"]
29345 pub sue_barom_alt: i32,
29346 #[doc = "Serial UDB Extra PWM Input Channel 1"]
29347 pub sue_pwm_input_1: i16,
29348 #[doc = "Serial UDB Extra PWM Input Channel 2"]
29349 pub sue_pwm_input_2: i16,
29350 #[doc = "Serial UDB Extra PWM Input Channel 3"]
29351 pub sue_pwm_input_3: i16,
29352 #[doc = "Serial UDB Extra PWM Input Channel 4"]
29353 pub sue_pwm_input_4: i16,
29354 #[doc = "Serial UDB Extra PWM Input Channel 5"]
29355 pub sue_pwm_input_5: i16,
29356 #[doc = "Serial UDB Extra PWM Input Channel 6"]
29357 pub sue_pwm_input_6: i16,
29358 #[doc = "Serial UDB Extra PWM Input Channel 7"]
29359 pub sue_pwm_input_7: i16,
29360 #[doc = "Serial UDB Extra PWM Input Channel 8"]
29361 pub sue_pwm_input_8: i16,
29362 #[doc = "Serial UDB Extra PWM Input Channel 9"]
29363 pub sue_pwm_input_9: i16,
29364 #[doc = "Serial UDB Extra PWM Input Channel 10"]
29365 pub sue_pwm_input_10: i16,
29366 #[doc = "Serial UDB Extra PWM Input Channel 11"]
29367 pub sue_pwm_input_11: i16,
29368 #[doc = "Serial UDB Extra PWM Input Channel 12"]
29369 pub sue_pwm_input_12: i16,
29370 #[doc = "Serial UDB Extra PWM Output Channel 1"]
29371 pub sue_pwm_output_1: i16,
29372 #[doc = "Serial UDB Extra PWM Output Channel 2"]
29373 pub sue_pwm_output_2: i16,
29374 #[doc = "Serial UDB Extra PWM Output Channel 3"]
29375 pub sue_pwm_output_3: i16,
29376 #[doc = "Serial UDB Extra PWM Output Channel 4"]
29377 pub sue_pwm_output_4: i16,
29378 #[doc = "Serial UDB Extra PWM Output Channel 5"]
29379 pub sue_pwm_output_5: i16,
29380 #[doc = "Serial UDB Extra PWM Output Channel 6"]
29381 pub sue_pwm_output_6: i16,
29382 #[doc = "Serial UDB Extra PWM Output Channel 7"]
29383 pub sue_pwm_output_7: i16,
29384 #[doc = "Serial UDB Extra PWM Output Channel 8"]
29385 pub sue_pwm_output_8: i16,
29386 #[doc = "Serial UDB Extra PWM Output Channel 9"]
29387 pub sue_pwm_output_9: i16,
29388 #[doc = "Serial UDB Extra PWM Output Channel 10"]
29389 pub sue_pwm_output_10: i16,
29390 #[doc = "Serial UDB Extra PWM Output Channel 11"]
29391 pub sue_pwm_output_11: i16,
29392 #[doc = "Serial UDB Extra PWM Output Channel 12"]
29393 pub sue_pwm_output_12: i16,
29394 #[doc = "Serial UDB Extra IMU Location X"]
29395 pub sue_imu_location_x: i16,
29396 #[doc = "Serial UDB Extra IMU Location Y"]
29397 pub sue_imu_location_y: i16,
29398 #[doc = "Serial UDB Extra IMU Location Z"]
29399 pub sue_imu_location_z: i16,
29400 #[doc = "Serial UDB Location Error Earth X"]
29401 pub sue_location_error_earth_x: i16,
29402 #[doc = "Serial UDB Location Error Earth Y"]
29403 pub sue_location_error_earth_y: i16,
29404 #[doc = "Serial UDB Location Error Earth Z"]
29405 pub sue_location_error_earth_z: i16,
29406 #[doc = "Serial UDB Extra Oscillator Failure Count"]
29407 pub sue_osc_fails: i16,
29408 #[doc = "Serial UDB Extra IMU Velocity X"]
29409 pub sue_imu_velocity_x: i16,
29410 #[doc = "Serial UDB Extra IMU Velocity Y"]
29411 pub sue_imu_velocity_y: i16,
29412 #[doc = "Serial UDB Extra IMU Velocity Z"]
29413 pub sue_imu_velocity_z: i16,
29414 #[doc = "Serial UDB Extra Current Waypoint Goal X"]
29415 pub sue_waypoint_goal_x: i16,
29416 #[doc = "Serial UDB Extra Current Waypoint Goal Y"]
29417 pub sue_waypoint_goal_y: i16,
29418 #[doc = "Serial UDB Extra Current Waypoint Goal Z"]
29419 pub sue_waypoint_goal_z: i16,
29420 #[doc = "Aeroforce in UDB X Axis"]
29421 pub sue_aero_x: i16,
29422 #[doc = "Aeroforce in UDB Y Axis"]
29423 pub sue_aero_y: i16,
29424 #[doc = "Aeroforce in UDB Z axis"]
29425 pub sue_aero_z: i16,
29426 #[doc = "SUE barometer temperature"]
29427 pub sue_barom_temp: i16,
29428 #[doc = "SUE battery voltage"]
29429 pub sue_bat_volt: i16,
29430 #[doc = "SUE battery current"]
29431 pub sue_bat_amp: i16,
29432 #[doc = "SUE battery milli amp hours used"]
29433 pub sue_bat_amp_hours: i16,
29434 #[doc = "Sue autopilot desired height"]
29435 pub sue_desired_height: i16,
29436 #[doc = "Serial UDB Extra Stack Memory Free"]
29437 pub sue_memory_stack_free: i16,
29438}
29439impl SERIAL_UDB_EXTRA_F2_B_DATA {
29440 pub const ENCODED_LEN: usize = 108usize;
29441 pub const DEFAULT: Self = Self {
29442 sue_time: 0_u32,
29443 sue_flags: 0_u32,
29444 sue_barom_press: 0_i32,
29445 sue_barom_alt: 0_i32,
29446 sue_pwm_input_1: 0_i16,
29447 sue_pwm_input_2: 0_i16,
29448 sue_pwm_input_3: 0_i16,
29449 sue_pwm_input_4: 0_i16,
29450 sue_pwm_input_5: 0_i16,
29451 sue_pwm_input_6: 0_i16,
29452 sue_pwm_input_7: 0_i16,
29453 sue_pwm_input_8: 0_i16,
29454 sue_pwm_input_9: 0_i16,
29455 sue_pwm_input_10: 0_i16,
29456 sue_pwm_input_11: 0_i16,
29457 sue_pwm_input_12: 0_i16,
29458 sue_pwm_output_1: 0_i16,
29459 sue_pwm_output_2: 0_i16,
29460 sue_pwm_output_3: 0_i16,
29461 sue_pwm_output_4: 0_i16,
29462 sue_pwm_output_5: 0_i16,
29463 sue_pwm_output_6: 0_i16,
29464 sue_pwm_output_7: 0_i16,
29465 sue_pwm_output_8: 0_i16,
29466 sue_pwm_output_9: 0_i16,
29467 sue_pwm_output_10: 0_i16,
29468 sue_pwm_output_11: 0_i16,
29469 sue_pwm_output_12: 0_i16,
29470 sue_imu_location_x: 0_i16,
29471 sue_imu_location_y: 0_i16,
29472 sue_imu_location_z: 0_i16,
29473 sue_location_error_earth_x: 0_i16,
29474 sue_location_error_earth_y: 0_i16,
29475 sue_location_error_earth_z: 0_i16,
29476 sue_osc_fails: 0_i16,
29477 sue_imu_velocity_x: 0_i16,
29478 sue_imu_velocity_y: 0_i16,
29479 sue_imu_velocity_z: 0_i16,
29480 sue_waypoint_goal_x: 0_i16,
29481 sue_waypoint_goal_y: 0_i16,
29482 sue_waypoint_goal_z: 0_i16,
29483 sue_aero_x: 0_i16,
29484 sue_aero_y: 0_i16,
29485 sue_aero_z: 0_i16,
29486 sue_barom_temp: 0_i16,
29487 sue_bat_volt: 0_i16,
29488 sue_bat_amp: 0_i16,
29489 sue_bat_amp_hours: 0_i16,
29490 sue_desired_height: 0_i16,
29491 sue_memory_stack_free: 0_i16,
29492 };
29493 #[cfg(feature = "arbitrary")]
29494 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29495 use arbitrary::{Arbitrary, Unstructured};
29496 let mut buf = [0u8; 1024];
29497 rng.fill_bytes(&mut buf);
29498 let mut unstructured = Unstructured::new(&buf);
29499 Self::arbitrary(&mut unstructured).unwrap_or_default()
29500 }
29501}
29502impl Default for SERIAL_UDB_EXTRA_F2_B_DATA {
29503 fn default() -> Self {
29504 Self::DEFAULT.clone()
29505 }
29506}
29507impl MessageData for SERIAL_UDB_EXTRA_F2_B_DATA {
29508 type Message = MavMessage;
29509 const ID: u32 = 171u32;
29510 const NAME: &'static str = "SERIAL_UDB_EXTRA_F2_B";
29511 const EXTRA_CRC: u8 = 245u8;
29512 const ENCODED_LEN: usize = 108usize;
29513 fn deser(
29514 _version: MavlinkVersion,
29515 __input: &[u8],
29516 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29517 let avail_len = __input.len();
29518 let mut payload_buf = [0; Self::ENCODED_LEN];
29519 let mut buf = if avail_len < Self::ENCODED_LEN {
29520 payload_buf[0..avail_len].copy_from_slice(__input);
29521 Bytes::new(&payload_buf)
29522 } else {
29523 Bytes::new(__input)
29524 };
29525 let mut __struct = Self::default();
29526 __struct.sue_time = buf.get_u32_le()?;
29527 __struct.sue_flags = buf.get_u32_le()?;
29528 __struct.sue_barom_press = buf.get_i32_le()?;
29529 __struct.sue_barom_alt = buf.get_i32_le()?;
29530 __struct.sue_pwm_input_1 = buf.get_i16_le()?;
29531 __struct.sue_pwm_input_2 = buf.get_i16_le()?;
29532 __struct.sue_pwm_input_3 = buf.get_i16_le()?;
29533 __struct.sue_pwm_input_4 = buf.get_i16_le()?;
29534 __struct.sue_pwm_input_5 = buf.get_i16_le()?;
29535 __struct.sue_pwm_input_6 = buf.get_i16_le()?;
29536 __struct.sue_pwm_input_7 = buf.get_i16_le()?;
29537 __struct.sue_pwm_input_8 = buf.get_i16_le()?;
29538 __struct.sue_pwm_input_9 = buf.get_i16_le()?;
29539 __struct.sue_pwm_input_10 = buf.get_i16_le()?;
29540 __struct.sue_pwm_input_11 = buf.get_i16_le()?;
29541 __struct.sue_pwm_input_12 = buf.get_i16_le()?;
29542 __struct.sue_pwm_output_1 = buf.get_i16_le()?;
29543 __struct.sue_pwm_output_2 = buf.get_i16_le()?;
29544 __struct.sue_pwm_output_3 = buf.get_i16_le()?;
29545 __struct.sue_pwm_output_4 = buf.get_i16_le()?;
29546 __struct.sue_pwm_output_5 = buf.get_i16_le()?;
29547 __struct.sue_pwm_output_6 = buf.get_i16_le()?;
29548 __struct.sue_pwm_output_7 = buf.get_i16_le()?;
29549 __struct.sue_pwm_output_8 = buf.get_i16_le()?;
29550 __struct.sue_pwm_output_9 = buf.get_i16_le()?;
29551 __struct.sue_pwm_output_10 = buf.get_i16_le()?;
29552 __struct.sue_pwm_output_11 = buf.get_i16_le()?;
29553 __struct.sue_pwm_output_12 = buf.get_i16_le()?;
29554 __struct.sue_imu_location_x = buf.get_i16_le()?;
29555 __struct.sue_imu_location_y = buf.get_i16_le()?;
29556 __struct.sue_imu_location_z = buf.get_i16_le()?;
29557 __struct.sue_location_error_earth_x = buf.get_i16_le()?;
29558 __struct.sue_location_error_earth_y = buf.get_i16_le()?;
29559 __struct.sue_location_error_earth_z = buf.get_i16_le()?;
29560 __struct.sue_osc_fails = buf.get_i16_le()?;
29561 __struct.sue_imu_velocity_x = buf.get_i16_le()?;
29562 __struct.sue_imu_velocity_y = buf.get_i16_le()?;
29563 __struct.sue_imu_velocity_z = buf.get_i16_le()?;
29564 __struct.sue_waypoint_goal_x = buf.get_i16_le()?;
29565 __struct.sue_waypoint_goal_y = buf.get_i16_le()?;
29566 __struct.sue_waypoint_goal_z = buf.get_i16_le()?;
29567 __struct.sue_aero_x = buf.get_i16_le()?;
29568 __struct.sue_aero_y = buf.get_i16_le()?;
29569 __struct.sue_aero_z = buf.get_i16_le()?;
29570 __struct.sue_barom_temp = buf.get_i16_le()?;
29571 __struct.sue_bat_volt = buf.get_i16_le()?;
29572 __struct.sue_bat_amp = buf.get_i16_le()?;
29573 __struct.sue_bat_amp_hours = buf.get_i16_le()?;
29574 __struct.sue_desired_height = buf.get_i16_le()?;
29575 __struct.sue_memory_stack_free = buf.get_i16_le()?;
29576 Ok(__struct)
29577 }
29578 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29579 let mut __tmp = BytesMut::new(bytes);
29580 #[allow(clippy::absurd_extreme_comparisons)]
29581 #[allow(unused_comparisons)]
29582 if __tmp.remaining() < Self::ENCODED_LEN {
29583 panic!(
29584 "buffer is too small (need {} bytes, but got {})",
29585 Self::ENCODED_LEN,
29586 __tmp.remaining(),
29587 )
29588 }
29589 __tmp.put_u32_le(self.sue_time);
29590 __tmp.put_u32_le(self.sue_flags);
29591 __tmp.put_i32_le(self.sue_barom_press);
29592 __tmp.put_i32_le(self.sue_barom_alt);
29593 __tmp.put_i16_le(self.sue_pwm_input_1);
29594 __tmp.put_i16_le(self.sue_pwm_input_2);
29595 __tmp.put_i16_le(self.sue_pwm_input_3);
29596 __tmp.put_i16_le(self.sue_pwm_input_4);
29597 __tmp.put_i16_le(self.sue_pwm_input_5);
29598 __tmp.put_i16_le(self.sue_pwm_input_6);
29599 __tmp.put_i16_le(self.sue_pwm_input_7);
29600 __tmp.put_i16_le(self.sue_pwm_input_8);
29601 __tmp.put_i16_le(self.sue_pwm_input_9);
29602 __tmp.put_i16_le(self.sue_pwm_input_10);
29603 __tmp.put_i16_le(self.sue_pwm_input_11);
29604 __tmp.put_i16_le(self.sue_pwm_input_12);
29605 __tmp.put_i16_le(self.sue_pwm_output_1);
29606 __tmp.put_i16_le(self.sue_pwm_output_2);
29607 __tmp.put_i16_le(self.sue_pwm_output_3);
29608 __tmp.put_i16_le(self.sue_pwm_output_4);
29609 __tmp.put_i16_le(self.sue_pwm_output_5);
29610 __tmp.put_i16_le(self.sue_pwm_output_6);
29611 __tmp.put_i16_le(self.sue_pwm_output_7);
29612 __tmp.put_i16_le(self.sue_pwm_output_8);
29613 __tmp.put_i16_le(self.sue_pwm_output_9);
29614 __tmp.put_i16_le(self.sue_pwm_output_10);
29615 __tmp.put_i16_le(self.sue_pwm_output_11);
29616 __tmp.put_i16_le(self.sue_pwm_output_12);
29617 __tmp.put_i16_le(self.sue_imu_location_x);
29618 __tmp.put_i16_le(self.sue_imu_location_y);
29619 __tmp.put_i16_le(self.sue_imu_location_z);
29620 __tmp.put_i16_le(self.sue_location_error_earth_x);
29621 __tmp.put_i16_le(self.sue_location_error_earth_y);
29622 __tmp.put_i16_le(self.sue_location_error_earth_z);
29623 __tmp.put_i16_le(self.sue_osc_fails);
29624 __tmp.put_i16_le(self.sue_imu_velocity_x);
29625 __tmp.put_i16_le(self.sue_imu_velocity_y);
29626 __tmp.put_i16_le(self.sue_imu_velocity_z);
29627 __tmp.put_i16_le(self.sue_waypoint_goal_x);
29628 __tmp.put_i16_le(self.sue_waypoint_goal_y);
29629 __tmp.put_i16_le(self.sue_waypoint_goal_z);
29630 __tmp.put_i16_le(self.sue_aero_x);
29631 __tmp.put_i16_le(self.sue_aero_y);
29632 __tmp.put_i16_le(self.sue_aero_z);
29633 __tmp.put_i16_le(self.sue_barom_temp);
29634 __tmp.put_i16_le(self.sue_bat_volt);
29635 __tmp.put_i16_le(self.sue_bat_amp);
29636 __tmp.put_i16_le(self.sue_bat_amp_hours);
29637 __tmp.put_i16_le(self.sue_desired_height);
29638 __tmp.put_i16_le(self.sue_memory_stack_free);
29639 if matches!(version, MavlinkVersion::V2) {
29640 let len = __tmp.len();
29641 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29642 } else {
29643 __tmp.len()
29644 }
29645 }
29646}
29647#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F4: format."]
29648#[doc = ""]
29649#[doc = "ID: 172"]
29650#[derive(Debug, Clone, PartialEq)]
29651#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29652#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29653#[cfg_attr(feature = "ts", derive(TS))]
29654#[cfg_attr(feature = "ts", ts(export))]
29655pub struct SERIAL_UDB_EXTRA_F4_DATA {
29656 #[doc = "Serial UDB Extra Roll Stabilization with Ailerons Enabled"]
29657 pub sue_ROLL_STABILIZATION_AILERONS: u8,
29658 #[doc = "Serial UDB Extra Roll Stabilization with Rudder Enabled"]
29659 pub sue_ROLL_STABILIZATION_RUDDER: u8,
29660 #[doc = "Serial UDB Extra Pitch Stabilization Enabled"]
29661 pub sue_PITCH_STABILIZATION: u8,
29662 #[doc = "Serial UDB Extra Yaw Stabilization using Rudder Enabled"]
29663 pub sue_YAW_STABILIZATION_RUDDER: u8,
29664 #[doc = "Serial UDB Extra Yaw Stabilization using Ailerons Enabled"]
29665 pub sue_YAW_STABILIZATION_AILERON: u8,
29666 #[doc = "Serial UDB Extra Navigation with Ailerons Enabled"]
29667 pub sue_AILERON_NAVIGATION: u8,
29668 #[doc = "Serial UDB Extra Navigation with Rudder Enabled"]
29669 pub sue_RUDDER_NAVIGATION: u8,
29670 #[doc = "Serial UDB Extra Type of Alitude Hold when in Stabilized Mode"]
29671 pub sue_ALTITUDEHOLD_STABILIZED: u8,
29672 #[doc = "Serial UDB Extra Type of Alitude Hold when in Waypoint Mode"]
29673 pub sue_ALTITUDEHOLD_WAYPOINT: u8,
29674 #[doc = "Serial UDB Extra Firmware racing mode enabled"]
29675 pub sue_RACING_MODE: u8,
29676}
29677impl SERIAL_UDB_EXTRA_F4_DATA {
29678 pub const ENCODED_LEN: usize = 10usize;
29679 pub const DEFAULT: Self = Self {
29680 sue_ROLL_STABILIZATION_AILERONS: 0_u8,
29681 sue_ROLL_STABILIZATION_RUDDER: 0_u8,
29682 sue_PITCH_STABILIZATION: 0_u8,
29683 sue_YAW_STABILIZATION_RUDDER: 0_u8,
29684 sue_YAW_STABILIZATION_AILERON: 0_u8,
29685 sue_AILERON_NAVIGATION: 0_u8,
29686 sue_RUDDER_NAVIGATION: 0_u8,
29687 sue_ALTITUDEHOLD_STABILIZED: 0_u8,
29688 sue_ALTITUDEHOLD_WAYPOINT: 0_u8,
29689 sue_RACING_MODE: 0_u8,
29690 };
29691 #[cfg(feature = "arbitrary")]
29692 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29693 use arbitrary::{Arbitrary, Unstructured};
29694 let mut buf = [0u8; 1024];
29695 rng.fill_bytes(&mut buf);
29696 let mut unstructured = Unstructured::new(&buf);
29697 Self::arbitrary(&mut unstructured).unwrap_or_default()
29698 }
29699}
29700impl Default for SERIAL_UDB_EXTRA_F4_DATA {
29701 fn default() -> Self {
29702 Self::DEFAULT.clone()
29703 }
29704}
29705impl MessageData for SERIAL_UDB_EXTRA_F4_DATA {
29706 type Message = MavMessage;
29707 const ID: u32 = 172u32;
29708 const NAME: &'static str = "SERIAL_UDB_EXTRA_F4";
29709 const EXTRA_CRC: u8 = 191u8;
29710 const ENCODED_LEN: usize = 10usize;
29711 fn deser(
29712 _version: MavlinkVersion,
29713 __input: &[u8],
29714 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29715 let avail_len = __input.len();
29716 let mut payload_buf = [0; Self::ENCODED_LEN];
29717 let mut buf = if avail_len < Self::ENCODED_LEN {
29718 payload_buf[0..avail_len].copy_from_slice(__input);
29719 Bytes::new(&payload_buf)
29720 } else {
29721 Bytes::new(__input)
29722 };
29723 let mut __struct = Self::default();
29724 __struct.sue_ROLL_STABILIZATION_AILERONS = buf.get_u8()?;
29725 __struct.sue_ROLL_STABILIZATION_RUDDER = buf.get_u8()?;
29726 __struct.sue_PITCH_STABILIZATION = buf.get_u8()?;
29727 __struct.sue_YAW_STABILIZATION_RUDDER = buf.get_u8()?;
29728 __struct.sue_YAW_STABILIZATION_AILERON = buf.get_u8()?;
29729 __struct.sue_AILERON_NAVIGATION = buf.get_u8()?;
29730 __struct.sue_RUDDER_NAVIGATION = buf.get_u8()?;
29731 __struct.sue_ALTITUDEHOLD_STABILIZED = buf.get_u8()?;
29732 __struct.sue_ALTITUDEHOLD_WAYPOINT = buf.get_u8()?;
29733 __struct.sue_RACING_MODE = buf.get_u8()?;
29734 Ok(__struct)
29735 }
29736 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29737 let mut __tmp = BytesMut::new(bytes);
29738 #[allow(clippy::absurd_extreme_comparisons)]
29739 #[allow(unused_comparisons)]
29740 if __tmp.remaining() < Self::ENCODED_LEN {
29741 panic!(
29742 "buffer is too small (need {} bytes, but got {})",
29743 Self::ENCODED_LEN,
29744 __tmp.remaining(),
29745 )
29746 }
29747 __tmp.put_u8(self.sue_ROLL_STABILIZATION_AILERONS);
29748 __tmp.put_u8(self.sue_ROLL_STABILIZATION_RUDDER);
29749 __tmp.put_u8(self.sue_PITCH_STABILIZATION);
29750 __tmp.put_u8(self.sue_YAW_STABILIZATION_RUDDER);
29751 __tmp.put_u8(self.sue_YAW_STABILIZATION_AILERON);
29752 __tmp.put_u8(self.sue_AILERON_NAVIGATION);
29753 __tmp.put_u8(self.sue_RUDDER_NAVIGATION);
29754 __tmp.put_u8(self.sue_ALTITUDEHOLD_STABILIZED);
29755 __tmp.put_u8(self.sue_ALTITUDEHOLD_WAYPOINT);
29756 __tmp.put_u8(self.sue_RACING_MODE);
29757 if matches!(version, MavlinkVersion::V2) {
29758 let len = __tmp.len();
29759 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29760 } else {
29761 __tmp.len()
29762 }
29763 }
29764}
29765#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F5: format."]
29766#[doc = ""]
29767#[doc = "ID: 173"]
29768#[derive(Debug, Clone, PartialEq)]
29769#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29770#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29771#[cfg_attr(feature = "ts", derive(TS))]
29772#[cfg_attr(feature = "ts", ts(export))]
29773pub struct SERIAL_UDB_EXTRA_F5_DATA {
29774 #[doc = "Serial UDB YAWKP_AILERON Gain for Proporional control of navigation"]
29775 pub sue_YAWKP_AILERON: f32,
29776 #[doc = "Serial UDB YAWKD_AILERON Gain for Rate control of navigation"]
29777 pub sue_YAWKD_AILERON: f32,
29778 #[doc = "Serial UDB Extra ROLLKP Gain for Proportional control of roll stabilization"]
29779 pub sue_ROLLKP: f32,
29780 #[doc = "Serial UDB Extra ROLLKD Gain for Rate control of roll stabilization"]
29781 pub sue_ROLLKD: f32,
29782}
29783impl SERIAL_UDB_EXTRA_F5_DATA {
29784 pub const ENCODED_LEN: usize = 16usize;
29785 pub const DEFAULT: Self = Self {
29786 sue_YAWKP_AILERON: 0.0_f32,
29787 sue_YAWKD_AILERON: 0.0_f32,
29788 sue_ROLLKP: 0.0_f32,
29789 sue_ROLLKD: 0.0_f32,
29790 };
29791 #[cfg(feature = "arbitrary")]
29792 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29793 use arbitrary::{Arbitrary, Unstructured};
29794 let mut buf = [0u8; 1024];
29795 rng.fill_bytes(&mut buf);
29796 let mut unstructured = Unstructured::new(&buf);
29797 Self::arbitrary(&mut unstructured).unwrap_or_default()
29798 }
29799}
29800impl Default for SERIAL_UDB_EXTRA_F5_DATA {
29801 fn default() -> Self {
29802 Self::DEFAULT.clone()
29803 }
29804}
29805impl MessageData for SERIAL_UDB_EXTRA_F5_DATA {
29806 type Message = MavMessage;
29807 const ID: u32 = 173u32;
29808 const NAME: &'static str = "SERIAL_UDB_EXTRA_F5";
29809 const EXTRA_CRC: u8 = 54u8;
29810 const ENCODED_LEN: usize = 16usize;
29811 fn deser(
29812 _version: MavlinkVersion,
29813 __input: &[u8],
29814 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29815 let avail_len = __input.len();
29816 let mut payload_buf = [0; Self::ENCODED_LEN];
29817 let mut buf = if avail_len < Self::ENCODED_LEN {
29818 payload_buf[0..avail_len].copy_from_slice(__input);
29819 Bytes::new(&payload_buf)
29820 } else {
29821 Bytes::new(__input)
29822 };
29823 let mut __struct = Self::default();
29824 __struct.sue_YAWKP_AILERON = buf.get_f32_le()?;
29825 __struct.sue_YAWKD_AILERON = buf.get_f32_le()?;
29826 __struct.sue_ROLLKP = buf.get_f32_le()?;
29827 __struct.sue_ROLLKD = buf.get_f32_le()?;
29828 Ok(__struct)
29829 }
29830 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29831 let mut __tmp = BytesMut::new(bytes);
29832 #[allow(clippy::absurd_extreme_comparisons)]
29833 #[allow(unused_comparisons)]
29834 if __tmp.remaining() < Self::ENCODED_LEN {
29835 panic!(
29836 "buffer is too small (need {} bytes, but got {})",
29837 Self::ENCODED_LEN,
29838 __tmp.remaining(),
29839 )
29840 }
29841 __tmp.put_f32_le(self.sue_YAWKP_AILERON);
29842 __tmp.put_f32_le(self.sue_YAWKD_AILERON);
29843 __tmp.put_f32_le(self.sue_ROLLKP);
29844 __tmp.put_f32_le(self.sue_ROLLKD);
29845 if matches!(version, MavlinkVersion::V2) {
29846 let len = __tmp.len();
29847 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29848 } else {
29849 __tmp.len()
29850 }
29851 }
29852}
29853#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F6: format."]
29854#[doc = ""]
29855#[doc = "ID: 174"]
29856#[derive(Debug, Clone, PartialEq)]
29857#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29858#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29859#[cfg_attr(feature = "ts", derive(TS))]
29860#[cfg_attr(feature = "ts", ts(export))]
29861pub struct SERIAL_UDB_EXTRA_F6_DATA {
29862 #[doc = "Serial UDB Extra PITCHGAIN Proportional Control"]
29863 pub sue_PITCHGAIN: f32,
29864 #[doc = "Serial UDB Extra Pitch Rate Control"]
29865 pub sue_PITCHKD: f32,
29866 #[doc = "Serial UDB Extra Rudder to Elevator Mix"]
29867 pub sue_RUDDER_ELEV_MIX: f32,
29868 #[doc = "Serial UDB Extra Roll to Elevator Mix"]
29869 pub sue_ROLL_ELEV_MIX: f32,
29870 #[doc = "Gain For Boosting Manual Elevator control When Plane Stabilized"]
29871 pub sue_ELEVATOR_BOOST: f32,
29872}
29873impl SERIAL_UDB_EXTRA_F6_DATA {
29874 pub const ENCODED_LEN: usize = 20usize;
29875 pub const DEFAULT: Self = Self {
29876 sue_PITCHGAIN: 0.0_f32,
29877 sue_PITCHKD: 0.0_f32,
29878 sue_RUDDER_ELEV_MIX: 0.0_f32,
29879 sue_ROLL_ELEV_MIX: 0.0_f32,
29880 sue_ELEVATOR_BOOST: 0.0_f32,
29881 };
29882 #[cfg(feature = "arbitrary")]
29883 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29884 use arbitrary::{Arbitrary, Unstructured};
29885 let mut buf = [0u8; 1024];
29886 rng.fill_bytes(&mut buf);
29887 let mut unstructured = Unstructured::new(&buf);
29888 Self::arbitrary(&mut unstructured).unwrap_or_default()
29889 }
29890}
29891impl Default for SERIAL_UDB_EXTRA_F6_DATA {
29892 fn default() -> Self {
29893 Self::DEFAULT.clone()
29894 }
29895}
29896impl MessageData for SERIAL_UDB_EXTRA_F6_DATA {
29897 type Message = MavMessage;
29898 const ID: u32 = 174u32;
29899 const NAME: &'static str = "SERIAL_UDB_EXTRA_F6";
29900 const EXTRA_CRC: u8 = 54u8;
29901 const ENCODED_LEN: usize = 20usize;
29902 fn deser(
29903 _version: MavlinkVersion,
29904 __input: &[u8],
29905 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29906 let avail_len = __input.len();
29907 let mut payload_buf = [0; Self::ENCODED_LEN];
29908 let mut buf = if avail_len < Self::ENCODED_LEN {
29909 payload_buf[0..avail_len].copy_from_slice(__input);
29910 Bytes::new(&payload_buf)
29911 } else {
29912 Bytes::new(__input)
29913 };
29914 let mut __struct = Self::default();
29915 __struct.sue_PITCHGAIN = buf.get_f32_le()?;
29916 __struct.sue_PITCHKD = buf.get_f32_le()?;
29917 __struct.sue_RUDDER_ELEV_MIX = buf.get_f32_le()?;
29918 __struct.sue_ROLL_ELEV_MIX = buf.get_f32_le()?;
29919 __struct.sue_ELEVATOR_BOOST = buf.get_f32_le()?;
29920 Ok(__struct)
29921 }
29922 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29923 let mut __tmp = BytesMut::new(bytes);
29924 #[allow(clippy::absurd_extreme_comparisons)]
29925 #[allow(unused_comparisons)]
29926 if __tmp.remaining() < Self::ENCODED_LEN {
29927 panic!(
29928 "buffer is too small (need {} bytes, but got {})",
29929 Self::ENCODED_LEN,
29930 __tmp.remaining(),
29931 )
29932 }
29933 __tmp.put_f32_le(self.sue_PITCHGAIN);
29934 __tmp.put_f32_le(self.sue_PITCHKD);
29935 __tmp.put_f32_le(self.sue_RUDDER_ELEV_MIX);
29936 __tmp.put_f32_le(self.sue_ROLL_ELEV_MIX);
29937 __tmp.put_f32_le(self.sue_ELEVATOR_BOOST);
29938 if matches!(version, MavlinkVersion::V2) {
29939 let len = __tmp.len();
29940 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29941 } else {
29942 __tmp.len()
29943 }
29944 }
29945}
29946#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F7: format."]
29947#[doc = ""]
29948#[doc = "ID: 175"]
29949#[derive(Debug, Clone, PartialEq)]
29950#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29951#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29952#[cfg_attr(feature = "ts", derive(TS))]
29953#[cfg_attr(feature = "ts", ts(export))]
29954pub struct SERIAL_UDB_EXTRA_F7_DATA {
29955 #[doc = "Serial UDB YAWKP_RUDDER Gain for Proporional control of navigation"]
29956 pub sue_YAWKP_RUDDER: f32,
29957 #[doc = "Serial UDB YAWKD_RUDDER Gain for Rate control of navigation"]
29958 pub sue_YAWKD_RUDDER: f32,
29959 #[doc = "Serial UDB Extra ROLLKP_RUDDER Gain for Proportional control of roll stabilization"]
29960 pub sue_ROLLKP_RUDDER: f32,
29961 #[doc = "Serial UDB Extra ROLLKD_RUDDER Gain for Rate control of roll stabilization"]
29962 pub sue_ROLLKD_RUDDER: f32,
29963 #[doc = "SERIAL UDB EXTRA Rudder Boost Gain to Manual Control when stabilized"]
29964 pub sue_RUDDER_BOOST: f32,
29965 #[doc = "Serial UDB Extra Return To Landing - Angle to Pitch Plane Down"]
29966 pub sue_RTL_PITCH_DOWN: f32,
29967}
29968impl SERIAL_UDB_EXTRA_F7_DATA {
29969 pub const ENCODED_LEN: usize = 24usize;
29970 pub const DEFAULT: Self = Self {
29971 sue_YAWKP_RUDDER: 0.0_f32,
29972 sue_YAWKD_RUDDER: 0.0_f32,
29973 sue_ROLLKP_RUDDER: 0.0_f32,
29974 sue_ROLLKD_RUDDER: 0.0_f32,
29975 sue_RUDDER_BOOST: 0.0_f32,
29976 sue_RTL_PITCH_DOWN: 0.0_f32,
29977 };
29978 #[cfg(feature = "arbitrary")]
29979 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29980 use arbitrary::{Arbitrary, Unstructured};
29981 let mut buf = [0u8; 1024];
29982 rng.fill_bytes(&mut buf);
29983 let mut unstructured = Unstructured::new(&buf);
29984 Self::arbitrary(&mut unstructured).unwrap_or_default()
29985 }
29986}
29987impl Default for SERIAL_UDB_EXTRA_F7_DATA {
29988 fn default() -> Self {
29989 Self::DEFAULT.clone()
29990 }
29991}
29992impl MessageData for SERIAL_UDB_EXTRA_F7_DATA {
29993 type Message = MavMessage;
29994 const ID: u32 = 175u32;
29995 const NAME: &'static str = "SERIAL_UDB_EXTRA_F7";
29996 const EXTRA_CRC: u8 = 171u8;
29997 const ENCODED_LEN: usize = 24usize;
29998 fn deser(
29999 _version: MavlinkVersion,
30000 __input: &[u8],
30001 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30002 let avail_len = __input.len();
30003 let mut payload_buf = [0; Self::ENCODED_LEN];
30004 let mut buf = if avail_len < Self::ENCODED_LEN {
30005 payload_buf[0..avail_len].copy_from_slice(__input);
30006 Bytes::new(&payload_buf)
30007 } else {
30008 Bytes::new(__input)
30009 };
30010 let mut __struct = Self::default();
30011 __struct.sue_YAWKP_RUDDER = buf.get_f32_le()?;
30012 __struct.sue_YAWKD_RUDDER = buf.get_f32_le()?;
30013 __struct.sue_ROLLKP_RUDDER = buf.get_f32_le()?;
30014 __struct.sue_ROLLKD_RUDDER = buf.get_f32_le()?;
30015 __struct.sue_RUDDER_BOOST = buf.get_f32_le()?;
30016 __struct.sue_RTL_PITCH_DOWN = buf.get_f32_le()?;
30017 Ok(__struct)
30018 }
30019 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30020 let mut __tmp = BytesMut::new(bytes);
30021 #[allow(clippy::absurd_extreme_comparisons)]
30022 #[allow(unused_comparisons)]
30023 if __tmp.remaining() < Self::ENCODED_LEN {
30024 panic!(
30025 "buffer is too small (need {} bytes, but got {})",
30026 Self::ENCODED_LEN,
30027 __tmp.remaining(),
30028 )
30029 }
30030 __tmp.put_f32_le(self.sue_YAWKP_RUDDER);
30031 __tmp.put_f32_le(self.sue_YAWKD_RUDDER);
30032 __tmp.put_f32_le(self.sue_ROLLKP_RUDDER);
30033 __tmp.put_f32_le(self.sue_ROLLKD_RUDDER);
30034 __tmp.put_f32_le(self.sue_RUDDER_BOOST);
30035 __tmp.put_f32_le(self.sue_RTL_PITCH_DOWN);
30036 if matches!(version, MavlinkVersion::V2) {
30037 let len = __tmp.len();
30038 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30039 } else {
30040 __tmp.len()
30041 }
30042 }
30043}
30044#[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F8: format."]
30045#[doc = ""]
30046#[doc = "ID: 176"]
30047#[derive(Debug, Clone, PartialEq)]
30048#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30049#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30050#[cfg_attr(feature = "ts", derive(TS))]
30051#[cfg_attr(feature = "ts", ts(export))]
30052pub struct SERIAL_UDB_EXTRA_F8_DATA {
30053 #[doc = "Serial UDB Extra HEIGHT_TARGET_MAX"]
30054 pub sue_HEIGHT_TARGET_MAX: f32,
30055 #[doc = "Serial UDB Extra HEIGHT_TARGET_MIN"]
30056 pub sue_HEIGHT_TARGET_MIN: f32,
30057 #[doc = "Serial UDB Extra ALT_HOLD_THROTTLE_MIN"]
30058 pub sue_ALT_HOLD_THROTTLE_MIN: f32,
30059 #[doc = "Serial UDB Extra ALT_HOLD_THROTTLE_MAX"]
30060 pub sue_ALT_HOLD_THROTTLE_MAX: f32,
30061 #[doc = "Serial UDB Extra ALT_HOLD_PITCH_MIN"]
30062 pub sue_ALT_HOLD_PITCH_MIN: f32,
30063 #[doc = "Serial UDB Extra ALT_HOLD_PITCH_MAX"]
30064 pub sue_ALT_HOLD_PITCH_MAX: f32,
30065 #[doc = "Serial UDB Extra ALT_HOLD_PITCH_HIGH"]
30066 pub sue_ALT_HOLD_PITCH_HIGH: f32,
30067}
30068impl SERIAL_UDB_EXTRA_F8_DATA {
30069 pub const ENCODED_LEN: usize = 28usize;
30070 pub const DEFAULT: Self = Self {
30071 sue_HEIGHT_TARGET_MAX: 0.0_f32,
30072 sue_HEIGHT_TARGET_MIN: 0.0_f32,
30073 sue_ALT_HOLD_THROTTLE_MIN: 0.0_f32,
30074 sue_ALT_HOLD_THROTTLE_MAX: 0.0_f32,
30075 sue_ALT_HOLD_PITCH_MIN: 0.0_f32,
30076 sue_ALT_HOLD_PITCH_MAX: 0.0_f32,
30077 sue_ALT_HOLD_PITCH_HIGH: 0.0_f32,
30078 };
30079 #[cfg(feature = "arbitrary")]
30080 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30081 use arbitrary::{Arbitrary, Unstructured};
30082 let mut buf = [0u8; 1024];
30083 rng.fill_bytes(&mut buf);
30084 let mut unstructured = Unstructured::new(&buf);
30085 Self::arbitrary(&mut unstructured).unwrap_or_default()
30086 }
30087}
30088impl Default for SERIAL_UDB_EXTRA_F8_DATA {
30089 fn default() -> Self {
30090 Self::DEFAULT.clone()
30091 }
30092}
30093impl MessageData for SERIAL_UDB_EXTRA_F8_DATA {
30094 type Message = MavMessage;
30095 const ID: u32 = 176u32;
30096 const NAME: &'static str = "SERIAL_UDB_EXTRA_F8";
30097 const EXTRA_CRC: u8 = 142u8;
30098 const ENCODED_LEN: usize = 28usize;
30099 fn deser(
30100 _version: MavlinkVersion,
30101 __input: &[u8],
30102 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30103 let avail_len = __input.len();
30104 let mut payload_buf = [0; Self::ENCODED_LEN];
30105 let mut buf = if avail_len < Self::ENCODED_LEN {
30106 payload_buf[0..avail_len].copy_from_slice(__input);
30107 Bytes::new(&payload_buf)
30108 } else {
30109 Bytes::new(__input)
30110 };
30111 let mut __struct = Self::default();
30112 __struct.sue_HEIGHT_TARGET_MAX = buf.get_f32_le()?;
30113 __struct.sue_HEIGHT_TARGET_MIN = buf.get_f32_le()?;
30114 __struct.sue_ALT_HOLD_THROTTLE_MIN = buf.get_f32_le()?;
30115 __struct.sue_ALT_HOLD_THROTTLE_MAX = buf.get_f32_le()?;
30116 __struct.sue_ALT_HOLD_PITCH_MIN = buf.get_f32_le()?;
30117 __struct.sue_ALT_HOLD_PITCH_MAX = buf.get_f32_le()?;
30118 __struct.sue_ALT_HOLD_PITCH_HIGH = buf.get_f32_le()?;
30119 Ok(__struct)
30120 }
30121 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30122 let mut __tmp = BytesMut::new(bytes);
30123 #[allow(clippy::absurd_extreme_comparisons)]
30124 #[allow(unused_comparisons)]
30125 if __tmp.remaining() < Self::ENCODED_LEN {
30126 panic!(
30127 "buffer is too small (need {} bytes, but got {})",
30128 Self::ENCODED_LEN,
30129 __tmp.remaining(),
30130 )
30131 }
30132 __tmp.put_f32_le(self.sue_HEIGHT_TARGET_MAX);
30133 __tmp.put_f32_le(self.sue_HEIGHT_TARGET_MIN);
30134 __tmp.put_f32_le(self.sue_ALT_HOLD_THROTTLE_MIN);
30135 __tmp.put_f32_le(self.sue_ALT_HOLD_THROTTLE_MAX);
30136 __tmp.put_f32_le(self.sue_ALT_HOLD_PITCH_MIN);
30137 __tmp.put_f32_le(self.sue_ALT_HOLD_PITCH_MAX);
30138 __tmp.put_f32_le(self.sue_ALT_HOLD_PITCH_HIGH);
30139 if matches!(version, MavlinkVersion::V2) {
30140 let len = __tmp.len();
30141 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30142 } else {
30143 __tmp.len()
30144 }
30145 }
30146}
30147#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
30148#[doc = ""]
30149#[doc = "ID: 36"]
30150#[derive(Debug, Clone, PartialEq)]
30151#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30152#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30153#[cfg_attr(feature = "ts", derive(TS))]
30154#[cfg_attr(feature = "ts", ts(export))]
30155pub struct SERVO_OUTPUT_RAW_DATA {
30156 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30157 pub time_usec: u32,
30158 #[doc = "Servo output 1 value"]
30159 pub servo1_raw: u16,
30160 #[doc = "Servo output 2 value"]
30161 pub servo2_raw: u16,
30162 #[doc = "Servo output 3 value"]
30163 pub servo3_raw: u16,
30164 #[doc = "Servo output 4 value"]
30165 pub servo4_raw: u16,
30166 #[doc = "Servo output 5 value"]
30167 pub servo5_raw: u16,
30168 #[doc = "Servo output 6 value"]
30169 pub servo6_raw: u16,
30170 #[doc = "Servo output 7 value"]
30171 pub servo7_raw: u16,
30172 #[doc = "Servo output 8 value"]
30173 pub servo8_raw: u16,
30174 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
30175 pub port: u8,
30176 #[doc = "Servo output 9 value"]
30177 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30178 pub servo9_raw: u16,
30179 #[doc = "Servo output 10 value"]
30180 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30181 pub servo10_raw: u16,
30182 #[doc = "Servo output 11 value"]
30183 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30184 pub servo11_raw: u16,
30185 #[doc = "Servo output 12 value"]
30186 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30187 pub servo12_raw: u16,
30188 #[doc = "Servo output 13 value"]
30189 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30190 pub servo13_raw: u16,
30191 #[doc = "Servo output 14 value"]
30192 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30193 pub servo14_raw: u16,
30194 #[doc = "Servo output 15 value"]
30195 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30196 pub servo15_raw: u16,
30197 #[doc = "Servo output 16 value"]
30198 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30199 pub servo16_raw: u16,
30200}
30201impl SERVO_OUTPUT_RAW_DATA {
30202 pub const ENCODED_LEN: usize = 37usize;
30203 pub const DEFAULT: Self = Self {
30204 time_usec: 0_u32,
30205 servo1_raw: 0_u16,
30206 servo2_raw: 0_u16,
30207 servo3_raw: 0_u16,
30208 servo4_raw: 0_u16,
30209 servo5_raw: 0_u16,
30210 servo6_raw: 0_u16,
30211 servo7_raw: 0_u16,
30212 servo8_raw: 0_u16,
30213 port: 0_u8,
30214 servo9_raw: 0_u16,
30215 servo10_raw: 0_u16,
30216 servo11_raw: 0_u16,
30217 servo12_raw: 0_u16,
30218 servo13_raw: 0_u16,
30219 servo14_raw: 0_u16,
30220 servo15_raw: 0_u16,
30221 servo16_raw: 0_u16,
30222 };
30223 #[cfg(feature = "arbitrary")]
30224 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30225 use arbitrary::{Arbitrary, Unstructured};
30226 let mut buf = [0u8; 1024];
30227 rng.fill_bytes(&mut buf);
30228 let mut unstructured = Unstructured::new(&buf);
30229 Self::arbitrary(&mut unstructured).unwrap_or_default()
30230 }
30231}
30232impl Default for SERVO_OUTPUT_RAW_DATA {
30233 fn default() -> Self {
30234 Self::DEFAULT.clone()
30235 }
30236}
30237impl MessageData for SERVO_OUTPUT_RAW_DATA {
30238 type Message = MavMessage;
30239 const ID: u32 = 36u32;
30240 const NAME: &'static str = "SERVO_OUTPUT_RAW";
30241 const EXTRA_CRC: u8 = 222u8;
30242 const ENCODED_LEN: usize = 37usize;
30243 fn deser(
30244 _version: MavlinkVersion,
30245 __input: &[u8],
30246 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30247 let avail_len = __input.len();
30248 let mut payload_buf = [0; Self::ENCODED_LEN];
30249 let mut buf = if avail_len < Self::ENCODED_LEN {
30250 payload_buf[0..avail_len].copy_from_slice(__input);
30251 Bytes::new(&payload_buf)
30252 } else {
30253 Bytes::new(__input)
30254 };
30255 let mut __struct = Self::default();
30256 __struct.time_usec = buf.get_u32_le()?;
30257 __struct.servo1_raw = buf.get_u16_le()?;
30258 __struct.servo2_raw = buf.get_u16_le()?;
30259 __struct.servo3_raw = buf.get_u16_le()?;
30260 __struct.servo4_raw = buf.get_u16_le()?;
30261 __struct.servo5_raw = buf.get_u16_le()?;
30262 __struct.servo6_raw = buf.get_u16_le()?;
30263 __struct.servo7_raw = buf.get_u16_le()?;
30264 __struct.servo8_raw = buf.get_u16_le()?;
30265 __struct.port = buf.get_u8()?;
30266 __struct.servo9_raw = buf.get_u16_le()?;
30267 __struct.servo10_raw = buf.get_u16_le()?;
30268 __struct.servo11_raw = buf.get_u16_le()?;
30269 __struct.servo12_raw = buf.get_u16_le()?;
30270 __struct.servo13_raw = buf.get_u16_le()?;
30271 __struct.servo14_raw = buf.get_u16_le()?;
30272 __struct.servo15_raw = buf.get_u16_le()?;
30273 __struct.servo16_raw = buf.get_u16_le()?;
30274 Ok(__struct)
30275 }
30276 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30277 let mut __tmp = BytesMut::new(bytes);
30278 #[allow(clippy::absurd_extreme_comparisons)]
30279 #[allow(unused_comparisons)]
30280 if __tmp.remaining() < Self::ENCODED_LEN {
30281 panic!(
30282 "buffer is too small (need {} bytes, but got {})",
30283 Self::ENCODED_LEN,
30284 __tmp.remaining(),
30285 )
30286 }
30287 __tmp.put_u32_le(self.time_usec);
30288 __tmp.put_u16_le(self.servo1_raw);
30289 __tmp.put_u16_le(self.servo2_raw);
30290 __tmp.put_u16_le(self.servo3_raw);
30291 __tmp.put_u16_le(self.servo4_raw);
30292 __tmp.put_u16_le(self.servo5_raw);
30293 __tmp.put_u16_le(self.servo6_raw);
30294 __tmp.put_u16_le(self.servo7_raw);
30295 __tmp.put_u16_le(self.servo8_raw);
30296 __tmp.put_u8(self.port);
30297 if matches!(version, MavlinkVersion::V2) {
30298 __tmp.put_u16_le(self.servo9_raw);
30299 __tmp.put_u16_le(self.servo10_raw);
30300 __tmp.put_u16_le(self.servo11_raw);
30301 __tmp.put_u16_le(self.servo12_raw);
30302 __tmp.put_u16_le(self.servo13_raw);
30303 __tmp.put_u16_le(self.servo14_raw);
30304 __tmp.put_u16_le(self.servo15_raw);
30305 __tmp.put_u16_le(self.servo16_raw);
30306 let len = __tmp.len();
30307 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30308 } else {
30309 __tmp.len()
30310 }
30311 }
30312}
30313#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
30314#[doc = ""]
30315#[doc = "ID: 256"]
30316#[derive(Debug, Clone, PartialEq)]
30317#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30318#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30319#[cfg_attr(feature = "ts", derive(TS))]
30320#[cfg_attr(feature = "ts", ts(export))]
30321pub struct SETUP_SIGNING_DATA {
30322 #[doc = "initial timestamp"]
30323 pub initial_timestamp: u64,
30324 #[doc = "system id of the target"]
30325 pub target_system: u8,
30326 #[doc = "component ID of the target"]
30327 pub target_component: u8,
30328 #[doc = "signing key"]
30329 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30330 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30331 pub secret_key: [u8; 32],
30332}
30333impl SETUP_SIGNING_DATA {
30334 pub const ENCODED_LEN: usize = 42usize;
30335 pub const DEFAULT: Self = Self {
30336 initial_timestamp: 0_u64,
30337 target_system: 0_u8,
30338 target_component: 0_u8,
30339 secret_key: [0_u8; 32usize],
30340 };
30341 #[cfg(feature = "arbitrary")]
30342 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30343 use arbitrary::{Arbitrary, Unstructured};
30344 let mut buf = [0u8; 1024];
30345 rng.fill_bytes(&mut buf);
30346 let mut unstructured = Unstructured::new(&buf);
30347 Self::arbitrary(&mut unstructured).unwrap_or_default()
30348 }
30349}
30350impl Default for SETUP_SIGNING_DATA {
30351 fn default() -> Self {
30352 Self::DEFAULT.clone()
30353 }
30354}
30355impl MessageData for SETUP_SIGNING_DATA {
30356 type Message = MavMessage;
30357 const ID: u32 = 256u32;
30358 const NAME: &'static str = "SETUP_SIGNING";
30359 const EXTRA_CRC: u8 = 71u8;
30360 const ENCODED_LEN: usize = 42usize;
30361 fn deser(
30362 _version: MavlinkVersion,
30363 __input: &[u8],
30364 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30365 let avail_len = __input.len();
30366 let mut payload_buf = [0; Self::ENCODED_LEN];
30367 let mut buf = if avail_len < Self::ENCODED_LEN {
30368 payload_buf[0..avail_len].copy_from_slice(__input);
30369 Bytes::new(&payload_buf)
30370 } else {
30371 Bytes::new(__input)
30372 };
30373 let mut __struct = Self::default();
30374 __struct.initial_timestamp = buf.get_u64_le()?;
30375 __struct.target_system = buf.get_u8()?;
30376 __struct.target_component = buf.get_u8()?;
30377 for v in &mut __struct.secret_key {
30378 let val = buf.get_u8()?;
30379 *v = val;
30380 }
30381 Ok(__struct)
30382 }
30383 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30384 let mut __tmp = BytesMut::new(bytes);
30385 #[allow(clippy::absurd_extreme_comparisons)]
30386 #[allow(unused_comparisons)]
30387 if __tmp.remaining() < Self::ENCODED_LEN {
30388 panic!(
30389 "buffer is too small (need {} bytes, but got {})",
30390 Self::ENCODED_LEN,
30391 __tmp.remaining(),
30392 )
30393 }
30394 __tmp.put_u64_le(self.initial_timestamp);
30395 __tmp.put_u8(self.target_system);
30396 __tmp.put_u8(self.target_component);
30397 for val in &self.secret_key {
30398 __tmp.put_u8(*val);
30399 }
30400 if matches!(version, MavlinkVersion::V2) {
30401 let len = __tmp.len();
30402 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30403 } else {
30404 __tmp.len()
30405 }
30406 }
30407}
30408#[doc = "Set the vehicle attitude and body angular rates."]
30409#[doc = ""]
30410#[doc = "ID: 139"]
30411#[derive(Debug, Clone, PartialEq)]
30412#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30413#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30414#[cfg_attr(feature = "ts", derive(TS))]
30415#[cfg_attr(feature = "ts", ts(export))]
30416pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
30417 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30418 pub time_usec: u64,
30419 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
30420 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30421 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30422 pub controls: [f32; 8],
30423 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
30424 pub group_mlx: u8,
30425 #[doc = "System ID"]
30426 pub target_system: u8,
30427 #[doc = "Component ID"]
30428 pub target_component: u8,
30429}
30430impl SET_ACTUATOR_CONTROL_TARGET_DATA {
30431 pub const ENCODED_LEN: usize = 43usize;
30432 pub const DEFAULT: Self = Self {
30433 time_usec: 0_u64,
30434 controls: [0.0_f32; 8usize],
30435 group_mlx: 0_u8,
30436 target_system: 0_u8,
30437 target_component: 0_u8,
30438 };
30439 #[cfg(feature = "arbitrary")]
30440 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30441 use arbitrary::{Arbitrary, Unstructured};
30442 let mut buf = [0u8; 1024];
30443 rng.fill_bytes(&mut buf);
30444 let mut unstructured = Unstructured::new(&buf);
30445 Self::arbitrary(&mut unstructured).unwrap_or_default()
30446 }
30447}
30448impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
30449 fn default() -> Self {
30450 Self::DEFAULT.clone()
30451 }
30452}
30453impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
30454 type Message = MavMessage;
30455 const ID: u32 = 139u32;
30456 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
30457 const EXTRA_CRC: u8 = 168u8;
30458 const ENCODED_LEN: usize = 43usize;
30459 fn deser(
30460 _version: MavlinkVersion,
30461 __input: &[u8],
30462 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30463 let avail_len = __input.len();
30464 let mut payload_buf = [0; Self::ENCODED_LEN];
30465 let mut buf = if avail_len < Self::ENCODED_LEN {
30466 payload_buf[0..avail_len].copy_from_slice(__input);
30467 Bytes::new(&payload_buf)
30468 } else {
30469 Bytes::new(__input)
30470 };
30471 let mut __struct = Self::default();
30472 __struct.time_usec = buf.get_u64_le()?;
30473 for v in &mut __struct.controls {
30474 let val = buf.get_f32_le()?;
30475 *v = val;
30476 }
30477 __struct.group_mlx = buf.get_u8()?;
30478 __struct.target_system = buf.get_u8()?;
30479 __struct.target_component = buf.get_u8()?;
30480 Ok(__struct)
30481 }
30482 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30483 let mut __tmp = BytesMut::new(bytes);
30484 #[allow(clippy::absurd_extreme_comparisons)]
30485 #[allow(unused_comparisons)]
30486 if __tmp.remaining() < Self::ENCODED_LEN {
30487 panic!(
30488 "buffer is too small (need {} bytes, but got {})",
30489 Self::ENCODED_LEN,
30490 __tmp.remaining(),
30491 )
30492 }
30493 __tmp.put_u64_le(self.time_usec);
30494 for val in &self.controls {
30495 __tmp.put_f32_le(*val);
30496 }
30497 __tmp.put_u8(self.group_mlx);
30498 __tmp.put_u8(self.target_system);
30499 __tmp.put_u8(self.target_component);
30500 if matches!(version, MavlinkVersion::V2) {
30501 let len = __tmp.len();
30502 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30503 } else {
30504 __tmp.len()
30505 }
30506 }
30507}
30508#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
30509#[doc = ""]
30510#[doc = "ID: 82"]
30511#[derive(Debug, Clone, PartialEq)]
30512#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30513#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30514#[cfg_attr(feature = "ts", derive(TS))]
30515#[cfg_attr(feature = "ts", ts(export))]
30516pub struct SET_ATTITUDE_TARGET_DATA {
30517 #[doc = "Timestamp (time since system boot)."]
30518 pub time_boot_ms: u32,
30519 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
30520 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30521 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30522 pub q: [f32; 4],
30523 #[doc = "Body roll rate"]
30524 pub body_roll_rate: f32,
30525 #[doc = "Body pitch rate"]
30526 pub body_pitch_rate: f32,
30527 #[doc = "Body yaw rate"]
30528 pub body_yaw_rate: f32,
30529 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
30530 pub thrust: f32,
30531 #[doc = "System ID"]
30532 pub target_system: u8,
30533 #[doc = "Component ID"]
30534 pub target_component: u8,
30535 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
30536 pub type_mask: AttitudeTargetTypemask,
30537 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
30538 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30539 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30540 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30541 pub thrust_body: [f32; 3],
30542}
30543impl SET_ATTITUDE_TARGET_DATA {
30544 pub const ENCODED_LEN: usize = 51usize;
30545 pub const DEFAULT: Self = Self {
30546 time_boot_ms: 0_u32,
30547 q: [0.0_f32; 4usize],
30548 body_roll_rate: 0.0_f32,
30549 body_pitch_rate: 0.0_f32,
30550 body_yaw_rate: 0.0_f32,
30551 thrust: 0.0_f32,
30552 target_system: 0_u8,
30553 target_component: 0_u8,
30554 type_mask: AttitudeTargetTypemask::DEFAULT,
30555 thrust_body: [0.0_f32; 3usize],
30556 };
30557 #[cfg(feature = "arbitrary")]
30558 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30559 use arbitrary::{Arbitrary, Unstructured};
30560 let mut buf = [0u8; 1024];
30561 rng.fill_bytes(&mut buf);
30562 let mut unstructured = Unstructured::new(&buf);
30563 Self::arbitrary(&mut unstructured).unwrap_or_default()
30564 }
30565}
30566impl Default for SET_ATTITUDE_TARGET_DATA {
30567 fn default() -> Self {
30568 Self::DEFAULT.clone()
30569 }
30570}
30571impl MessageData for SET_ATTITUDE_TARGET_DATA {
30572 type Message = MavMessage;
30573 const ID: u32 = 82u32;
30574 const NAME: &'static str = "SET_ATTITUDE_TARGET";
30575 const EXTRA_CRC: u8 = 49u8;
30576 const ENCODED_LEN: usize = 51usize;
30577 fn deser(
30578 _version: MavlinkVersion,
30579 __input: &[u8],
30580 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30581 let avail_len = __input.len();
30582 let mut payload_buf = [0; Self::ENCODED_LEN];
30583 let mut buf = if avail_len < Self::ENCODED_LEN {
30584 payload_buf[0..avail_len].copy_from_slice(__input);
30585 Bytes::new(&payload_buf)
30586 } else {
30587 Bytes::new(__input)
30588 };
30589 let mut __struct = Self::default();
30590 __struct.time_boot_ms = buf.get_u32_le()?;
30591 for v in &mut __struct.q {
30592 let val = buf.get_f32_le()?;
30593 *v = val;
30594 }
30595 __struct.body_roll_rate = buf.get_f32_le()?;
30596 __struct.body_pitch_rate = buf.get_f32_le()?;
30597 __struct.body_yaw_rate = buf.get_f32_le()?;
30598 __struct.thrust = buf.get_f32_le()?;
30599 __struct.target_system = buf.get_u8()?;
30600 __struct.target_component = buf.get_u8()?;
30601 let tmp = buf.get_u8()?;
30602 __struct.type_mask =
30603 AttitudeTargetTypemask::from_bits(tmp as <AttitudeTargetTypemask as Flags>::Bits)
30604 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30605 flag_type: "AttitudeTargetTypemask",
30606 value: tmp as u64,
30607 })?;
30608 for v in &mut __struct.thrust_body {
30609 let val = buf.get_f32_le()?;
30610 *v = val;
30611 }
30612 Ok(__struct)
30613 }
30614 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30615 let mut __tmp = BytesMut::new(bytes);
30616 #[allow(clippy::absurd_extreme_comparisons)]
30617 #[allow(unused_comparisons)]
30618 if __tmp.remaining() < Self::ENCODED_LEN {
30619 panic!(
30620 "buffer is too small (need {} bytes, but got {})",
30621 Self::ENCODED_LEN,
30622 __tmp.remaining(),
30623 )
30624 }
30625 __tmp.put_u32_le(self.time_boot_ms);
30626 for val in &self.q {
30627 __tmp.put_f32_le(*val);
30628 }
30629 __tmp.put_f32_le(self.body_roll_rate);
30630 __tmp.put_f32_le(self.body_pitch_rate);
30631 __tmp.put_f32_le(self.body_yaw_rate);
30632 __tmp.put_f32_le(self.thrust);
30633 __tmp.put_u8(self.target_system);
30634 __tmp.put_u8(self.target_component);
30635 __tmp.put_u8(self.type_mask.bits() as u8);
30636 if matches!(version, MavlinkVersion::V2) {
30637 for val in &self.thrust_body {
30638 __tmp.put_f32_le(*val);
30639 }
30640 let len = __tmp.len();
30641 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30642 } else {
30643 __tmp.len()
30644 }
30645 }
30646}
30647#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
30648#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
30649#[doc = ""]
30650#[doc = "ID: 48"]
30651#[derive(Debug, Clone, PartialEq)]
30652#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30653#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30654#[cfg_attr(feature = "ts", derive(TS))]
30655#[cfg_attr(feature = "ts", ts(export))]
30656pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
30657 #[doc = "Latitude (WGS84)"]
30658 pub latitude: i32,
30659 #[doc = "Longitude (WGS84)"]
30660 pub longitude: i32,
30661 #[doc = "Altitude (MSL). Positive for up."]
30662 pub altitude: i32,
30663 #[doc = "System ID"]
30664 pub target_system: u8,
30665 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30666 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30667 pub time_usec: u64,
30668}
30669impl SET_GPS_GLOBAL_ORIGIN_DATA {
30670 pub const ENCODED_LEN: usize = 21usize;
30671 pub const DEFAULT: Self = Self {
30672 latitude: 0_i32,
30673 longitude: 0_i32,
30674 altitude: 0_i32,
30675 target_system: 0_u8,
30676 time_usec: 0_u64,
30677 };
30678 #[cfg(feature = "arbitrary")]
30679 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30680 use arbitrary::{Arbitrary, Unstructured};
30681 let mut buf = [0u8; 1024];
30682 rng.fill_bytes(&mut buf);
30683 let mut unstructured = Unstructured::new(&buf);
30684 Self::arbitrary(&mut unstructured).unwrap_or_default()
30685 }
30686}
30687impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
30688 fn default() -> Self {
30689 Self::DEFAULT.clone()
30690 }
30691}
30692impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
30693 type Message = MavMessage;
30694 const ID: u32 = 48u32;
30695 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
30696 const EXTRA_CRC: u8 = 41u8;
30697 const ENCODED_LEN: usize = 21usize;
30698 fn deser(
30699 _version: MavlinkVersion,
30700 __input: &[u8],
30701 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30702 let avail_len = __input.len();
30703 let mut payload_buf = [0; Self::ENCODED_LEN];
30704 let mut buf = if avail_len < Self::ENCODED_LEN {
30705 payload_buf[0..avail_len].copy_from_slice(__input);
30706 Bytes::new(&payload_buf)
30707 } else {
30708 Bytes::new(__input)
30709 };
30710 let mut __struct = Self::default();
30711 __struct.latitude = buf.get_i32_le()?;
30712 __struct.longitude = buf.get_i32_le()?;
30713 __struct.altitude = buf.get_i32_le()?;
30714 __struct.target_system = buf.get_u8()?;
30715 __struct.time_usec = buf.get_u64_le()?;
30716 Ok(__struct)
30717 }
30718 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30719 let mut __tmp = BytesMut::new(bytes);
30720 #[allow(clippy::absurd_extreme_comparisons)]
30721 #[allow(unused_comparisons)]
30722 if __tmp.remaining() < Self::ENCODED_LEN {
30723 panic!(
30724 "buffer is too small (need {} bytes, but got {})",
30725 Self::ENCODED_LEN,
30726 __tmp.remaining(),
30727 )
30728 }
30729 __tmp.put_i32_le(self.latitude);
30730 __tmp.put_i32_le(self.longitude);
30731 __tmp.put_i32_le(self.altitude);
30732 __tmp.put_u8(self.target_system);
30733 if matches!(version, MavlinkVersion::V2) {
30734 __tmp.put_u64_le(self.time_usec);
30735 let len = __tmp.len();
30736 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30737 } else {
30738 __tmp.len()
30739 }
30740 }
30741}
30742#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
30743#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
30744#[doc = ""]
30745#[doc = "ID: 243"]
30746#[derive(Debug, Clone, PartialEq)]
30747#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30748#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30749#[cfg_attr(feature = "ts", derive(TS))]
30750#[cfg_attr(feature = "ts", ts(export))]
30751pub struct SET_HOME_POSITION_DATA {
30752 #[doc = "Latitude (WGS84)"]
30753 pub latitude: i32,
30754 #[doc = "Longitude (WGS84)"]
30755 pub longitude: i32,
30756 #[doc = "Altitude (MSL). Positive for up."]
30757 pub altitude: i32,
30758 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
30759 pub x: f32,
30760 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
30761 pub y: f32,
30762 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
30763 pub z: f32,
30764 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
30765 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30766 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30767 pub q: [f32; 4],
30768 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
30769 pub approach_x: f32,
30770 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
30771 pub approach_y: f32,
30772 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
30773 pub approach_z: f32,
30774 #[doc = "System ID."]
30775 pub target_system: u8,
30776 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30777 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30778 pub time_usec: u64,
30779}
30780impl SET_HOME_POSITION_DATA {
30781 pub const ENCODED_LEN: usize = 61usize;
30782 pub const DEFAULT: Self = Self {
30783 latitude: 0_i32,
30784 longitude: 0_i32,
30785 altitude: 0_i32,
30786 x: 0.0_f32,
30787 y: 0.0_f32,
30788 z: 0.0_f32,
30789 q: [0.0_f32; 4usize],
30790 approach_x: 0.0_f32,
30791 approach_y: 0.0_f32,
30792 approach_z: 0.0_f32,
30793 target_system: 0_u8,
30794 time_usec: 0_u64,
30795 };
30796 #[cfg(feature = "arbitrary")]
30797 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30798 use arbitrary::{Arbitrary, Unstructured};
30799 let mut buf = [0u8; 1024];
30800 rng.fill_bytes(&mut buf);
30801 let mut unstructured = Unstructured::new(&buf);
30802 Self::arbitrary(&mut unstructured).unwrap_or_default()
30803 }
30804}
30805impl Default for SET_HOME_POSITION_DATA {
30806 fn default() -> Self {
30807 Self::DEFAULT.clone()
30808 }
30809}
30810impl MessageData for SET_HOME_POSITION_DATA {
30811 type Message = MavMessage;
30812 const ID: u32 = 243u32;
30813 const NAME: &'static str = "SET_HOME_POSITION";
30814 const EXTRA_CRC: u8 = 85u8;
30815 const ENCODED_LEN: usize = 61usize;
30816 fn deser(
30817 _version: MavlinkVersion,
30818 __input: &[u8],
30819 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30820 let avail_len = __input.len();
30821 let mut payload_buf = [0; Self::ENCODED_LEN];
30822 let mut buf = if avail_len < Self::ENCODED_LEN {
30823 payload_buf[0..avail_len].copy_from_slice(__input);
30824 Bytes::new(&payload_buf)
30825 } else {
30826 Bytes::new(__input)
30827 };
30828 let mut __struct = Self::default();
30829 __struct.latitude = buf.get_i32_le()?;
30830 __struct.longitude = buf.get_i32_le()?;
30831 __struct.altitude = buf.get_i32_le()?;
30832 __struct.x = buf.get_f32_le()?;
30833 __struct.y = buf.get_f32_le()?;
30834 __struct.z = buf.get_f32_le()?;
30835 for v in &mut __struct.q {
30836 let val = buf.get_f32_le()?;
30837 *v = val;
30838 }
30839 __struct.approach_x = buf.get_f32_le()?;
30840 __struct.approach_y = buf.get_f32_le()?;
30841 __struct.approach_z = buf.get_f32_le()?;
30842 __struct.target_system = buf.get_u8()?;
30843 __struct.time_usec = buf.get_u64_le()?;
30844 Ok(__struct)
30845 }
30846 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30847 let mut __tmp = BytesMut::new(bytes);
30848 #[allow(clippy::absurd_extreme_comparisons)]
30849 #[allow(unused_comparisons)]
30850 if __tmp.remaining() < Self::ENCODED_LEN {
30851 panic!(
30852 "buffer is too small (need {} bytes, but got {})",
30853 Self::ENCODED_LEN,
30854 __tmp.remaining(),
30855 )
30856 }
30857 __tmp.put_i32_le(self.latitude);
30858 __tmp.put_i32_le(self.longitude);
30859 __tmp.put_i32_le(self.altitude);
30860 __tmp.put_f32_le(self.x);
30861 __tmp.put_f32_le(self.y);
30862 __tmp.put_f32_le(self.z);
30863 for val in &self.q {
30864 __tmp.put_f32_le(*val);
30865 }
30866 __tmp.put_f32_le(self.approach_x);
30867 __tmp.put_f32_le(self.approach_y);
30868 __tmp.put_f32_le(self.approach_z);
30869 __tmp.put_u8(self.target_system);
30870 if matches!(version, MavlinkVersion::V2) {
30871 __tmp.put_u64_le(self.time_usec);
30872 let len = __tmp.len();
30873 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30874 } else {
30875 __tmp.len()
30876 }
30877 }
30878}
30879#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
30880#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
30881#[doc = ""]
30882#[doc = "ID: 11"]
30883#[derive(Debug, Clone, PartialEq)]
30884#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30885#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30886#[cfg_attr(feature = "ts", derive(TS))]
30887#[cfg_attr(feature = "ts", ts(export))]
30888pub struct SET_MODE_DATA {
30889 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
30890 pub custom_mode: u32,
30891 #[doc = "The system setting the mode"]
30892 pub target_system: u8,
30893 #[doc = "The new base mode."]
30894 pub base_mode: MavMode,
30895}
30896impl SET_MODE_DATA {
30897 pub const ENCODED_LEN: usize = 6usize;
30898 pub const DEFAULT: Self = Self {
30899 custom_mode: 0_u32,
30900 target_system: 0_u8,
30901 base_mode: MavMode::DEFAULT,
30902 };
30903 #[cfg(feature = "arbitrary")]
30904 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30905 use arbitrary::{Arbitrary, Unstructured};
30906 let mut buf = [0u8; 1024];
30907 rng.fill_bytes(&mut buf);
30908 let mut unstructured = Unstructured::new(&buf);
30909 Self::arbitrary(&mut unstructured).unwrap_or_default()
30910 }
30911}
30912impl Default for SET_MODE_DATA {
30913 fn default() -> Self {
30914 Self::DEFAULT.clone()
30915 }
30916}
30917impl MessageData for SET_MODE_DATA {
30918 type Message = MavMessage;
30919 const ID: u32 = 11u32;
30920 const NAME: &'static str = "SET_MODE";
30921 const EXTRA_CRC: u8 = 89u8;
30922 const ENCODED_LEN: usize = 6usize;
30923 fn deser(
30924 _version: MavlinkVersion,
30925 __input: &[u8],
30926 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30927 let avail_len = __input.len();
30928 let mut payload_buf = [0; Self::ENCODED_LEN];
30929 let mut buf = if avail_len < Self::ENCODED_LEN {
30930 payload_buf[0..avail_len].copy_from_slice(__input);
30931 Bytes::new(&payload_buf)
30932 } else {
30933 Bytes::new(__input)
30934 };
30935 let mut __struct = Self::default();
30936 __struct.custom_mode = buf.get_u32_le()?;
30937 __struct.target_system = buf.get_u8()?;
30938 let tmp = buf.get_u8()?;
30939 __struct.base_mode =
30940 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30941 enum_type: "MavMode",
30942 value: tmp as u64,
30943 })?;
30944 Ok(__struct)
30945 }
30946 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30947 let mut __tmp = BytesMut::new(bytes);
30948 #[allow(clippy::absurd_extreme_comparisons)]
30949 #[allow(unused_comparisons)]
30950 if __tmp.remaining() < Self::ENCODED_LEN {
30951 panic!(
30952 "buffer is too small (need {} bytes, but got {})",
30953 Self::ENCODED_LEN,
30954 __tmp.remaining(),
30955 )
30956 }
30957 __tmp.put_u32_le(self.custom_mode);
30958 __tmp.put_u8(self.target_system);
30959 __tmp.put_u8(self.base_mode as u8);
30960 if matches!(version, MavlinkVersion::V2) {
30961 let len = __tmp.len();
30962 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30963 } else {
30964 __tmp.len()
30965 }
30966 }
30967}
30968#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
30969#[doc = ""]
30970#[doc = "ID: 86"]
30971#[derive(Debug, Clone, PartialEq)]
30972#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30973#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30974#[cfg_attr(feature = "ts", derive(TS))]
30975#[cfg_attr(feature = "ts", ts(export))]
30976pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
30977 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
30978 pub time_boot_ms: u32,
30979 #[doc = "Latitude in WGS84 frame"]
30980 pub lat_int: i32,
30981 #[doc = "Longitude in WGS84 frame"]
30982 pub lon_int: i32,
30983 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
30984 pub alt: f32,
30985 #[doc = "X velocity in NED frame"]
30986 pub vx: f32,
30987 #[doc = "Y velocity in NED frame"]
30988 pub vy: f32,
30989 #[doc = "Z velocity in NED frame"]
30990 pub vz: f32,
30991 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
30992 pub afx: f32,
30993 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
30994 pub afy: f32,
30995 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
30996 pub afz: f32,
30997 #[doc = "yaw setpoint"]
30998 pub yaw: f32,
30999 #[doc = "yaw rate setpoint"]
31000 pub yaw_rate: f32,
31001 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
31002 pub type_mask: PositionTargetTypemask,
31003 #[doc = "System ID"]
31004 pub target_system: u8,
31005 #[doc = "Component ID"]
31006 pub target_component: u8,
31007 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
31008 pub coordinate_frame: MavFrame,
31009}
31010impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
31011 pub const ENCODED_LEN: usize = 53usize;
31012 pub const DEFAULT: Self = Self {
31013 time_boot_ms: 0_u32,
31014 lat_int: 0_i32,
31015 lon_int: 0_i32,
31016 alt: 0.0_f32,
31017 vx: 0.0_f32,
31018 vy: 0.0_f32,
31019 vz: 0.0_f32,
31020 afx: 0.0_f32,
31021 afy: 0.0_f32,
31022 afz: 0.0_f32,
31023 yaw: 0.0_f32,
31024 yaw_rate: 0.0_f32,
31025 type_mask: PositionTargetTypemask::DEFAULT,
31026 target_system: 0_u8,
31027 target_component: 0_u8,
31028 coordinate_frame: MavFrame::DEFAULT,
31029 };
31030 #[cfg(feature = "arbitrary")]
31031 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31032 use arbitrary::{Arbitrary, Unstructured};
31033 let mut buf = [0u8; 1024];
31034 rng.fill_bytes(&mut buf);
31035 let mut unstructured = Unstructured::new(&buf);
31036 Self::arbitrary(&mut unstructured).unwrap_or_default()
31037 }
31038}
31039impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
31040 fn default() -> Self {
31041 Self::DEFAULT.clone()
31042 }
31043}
31044impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
31045 type Message = MavMessage;
31046 const ID: u32 = 86u32;
31047 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
31048 const EXTRA_CRC: u8 = 5u8;
31049 const ENCODED_LEN: usize = 53usize;
31050 fn deser(
31051 _version: MavlinkVersion,
31052 __input: &[u8],
31053 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31054 let avail_len = __input.len();
31055 let mut payload_buf = [0; Self::ENCODED_LEN];
31056 let mut buf = if avail_len < Self::ENCODED_LEN {
31057 payload_buf[0..avail_len].copy_from_slice(__input);
31058 Bytes::new(&payload_buf)
31059 } else {
31060 Bytes::new(__input)
31061 };
31062 let mut __struct = Self::default();
31063 __struct.time_boot_ms = buf.get_u32_le()?;
31064 __struct.lat_int = buf.get_i32_le()?;
31065 __struct.lon_int = buf.get_i32_le()?;
31066 __struct.alt = buf.get_f32_le()?;
31067 __struct.vx = buf.get_f32_le()?;
31068 __struct.vy = buf.get_f32_le()?;
31069 __struct.vz = buf.get_f32_le()?;
31070 __struct.afx = buf.get_f32_le()?;
31071 __struct.afy = buf.get_f32_le()?;
31072 __struct.afz = buf.get_f32_le()?;
31073 __struct.yaw = buf.get_f32_le()?;
31074 __struct.yaw_rate = buf.get_f32_le()?;
31075 let tmp = buf.get_u16_le()?;
31076 __struct.type_mask =
31077 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
31078 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31079 flag_type: "PositionTargetTypemask",
31080 value: tmp as u64,
31081 })?;
31082 __struct.target_system = buf.get_u8()?;
31083 __struct.target_component = buf.get_u8()?;
31084 let tmp = buf.get_u8()?;
31085 __struct.coordinate_frame =
31086 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31087 enum_type: "MavFrame",
31088 value: tmp as u64,
31089 })?;
31090 Ok(__struct)
31091 }
31092 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31093 let mut __tmp = BytesMut::new(bytes);
31094 #[allow(clippy::absurd_extreme_comparisons)]
31095 #[allow(unused_comparisons)]
31096 if __tmp.remaining() < Self::ENCODED_LEN {
31097 panic!(
31098 "buffer is too small (need {} bytes, but got {})",
31099 Self::ENCODED_LEN,
31100 __tmp.remaining(),
31101 )
31102 }
31103 __tmp.put_u32_le(self.time_boot_ms);
31104 __tmp.put_i32_le(self.lat_int);
31105 __tmp.put_i32_le(self.lon_int);
31106 __tmp.put_f32_le(self.alt);
31107 __tmp.put_f32_le(self.vx);
31108 __tmp.put_f32_le(self.vy);
31109 __tmp.put_f32_le(self.vz);
31110 __tmp.put_f32_le(self.afx);
31111 __tmp.put_f32_le(self.afy);
31112 __tmp.put_f32_le(self.afz);
31113 __tmp.put_f32_le(self.yaw);
31114 __tmp.put_f32_le(self.yaw_rate);
31115 __tmp.put_u16_le(self.type_mask.bits() as u16);
31116 __tmp.put_u8(self.target_system);
31117 __tmp.put_u8(self.target_component);
31118 __tmp.put_u8(self.coordinate_frame as u8);
31119 if matches!(version, MavlinkVersion::V2) {
31120 let len = __tmp.len();
31121 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31122 } else {
31123 __tmp.len()
31124 }
31125 }
31126}
31127#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
31128#[doc = ""]
31129#[doc = "ID: 84"]
31130#[derive(Debug, Clone, PartialEq)]
31131#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31133#[cfg_attr(feature = "ts", derive(TS))]
31134#[cfg_attr(feature = "ts", ts(export))]
31135pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
31136 #[doc = "Timestamp (time since system boot)."]
31137 pub time_boot_ms: u32,
31138 #[doc = "X Position in NED frame"]
31139 pub x: f32,
31140 #[doc = "Y Position in NED frame"]
31141 pub y: f32,
31142 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
31143 pub z: f32,
31144 #[doc = "X velocity in NED frame"]
31145 pub vx: f32,
31146 #[doc = "Y velocity in NED frame"]
31147 pub vy: f32,
31148 #[doc = "Z velocity in NED frame"]
31149 pub vz: f32,
31150 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
31151 pub afx: f32,
31152 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
31153 pub afy: f32,
31154 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
31155 pub afz: f32,
31156 #[doc = "yaw setpoint"]
31157 pub yaw: f32,
31158 #[doc = "yaw rate setpoint"]
31159 pub yaw_rate: f32,
31160 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
31161 pub type_mask: PositionTargetTypemask,
31162 #[doc = "System ID"]
31163 pub target_system: u8,
31164 #[doc = "Component ID"]
31165 pub target_component: u8,
31166 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
31167 pub coordinate_frame: MavFrame,
31168}
31169impl SET_POSITION_TARGET_LOCAL_NED_DATA {
31170 pub const ENCODED_LEN: usize = 53usize;
31171 pub const DEFAULT: Self = Self {
31172 time_boot_ms: 0_u32,
31173 x: 0.0_f32,
31174 y: 0.0_f32,
31175 z: 0.0_f32,
31176 vx: 0.0_f32,
31177 vy: 0.0_f32,
31178 vz: 0.0_f32,
31179 afx: 0.0_f32,
31180 afy: 0.0_f32,
31181 afz: 0.0_f32,
31182 yaw: 0.0_f32,
31183 yaw_rate: 0.0_f32,
31184 type_mask: PositionTargetTypemask::DEFAULT,
31185 target_system: 0_u8,
31186 target_component: 0_u8,
31187 coordinate_frame: MavFrame::DEFAULT,
31188 };
31189 #[cfg(feature = "arbitrary")]
31190 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31191 use arbitrary::{Arbitrary, Unstructured};
31192 let mut buf = [0u8; 1024];
31193 rng.fill_bytes(&mut buf);
31194 let mut unstructured = Unstructured::new(&buf);
31195 Self::arbitrary(&mut unstructured).unwrap_or_default()
31196 }
31197}
31198impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
31199 fn default() -> Self {
31200 Self::DEFAULT.clone()
31201 }
31202}
31203impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
31204 type Message = MavMessage;
31205 const ID: u32 = 84u32;
31206 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
31207 const EXTRA_CRC: u8 = 143u8;
31208 const ENCODED_LEN: usize = 53usize;
31209 fn deser(
31210 _version: MavlinkVersion,
31211 __input: &[u8],
31212 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31213 let avail_len = __input.len();
31214 let mut payload_buf = [0; Self::ENCODED_LEN];
31215 let mut buf = if avail_len < Self::ENCODED_LEN {
31216 payload_buf[0..avail_len].copy_from_slice(__input);
31217 Bytes::new(&payload_buf)
31218 } else {
31219 Bytes::new(__input)
31220 };
31221 let mut __struct = Self::default();
31222 __struct.time_boot_ms = buf.get_u32_le()?;
31223 __struct.x = buf.get_f32_le()?;
31224 __struct.y = buf.get_f32_le()?;
31225 __struct.z = buf.get_f32_le()?;
31226 __struct.vx = buf.get_f32_le()?;
31227 __struct.vy = buf.get_f32_le()?;
31228 __struct.vz = buf.get_f32_le()?;
31229 __struct.afx = buf.get_f32_le()?;
31230 __struct.afy = buf.get_f32_le()?;
31231 __struct.afz = buf.get_f32_le()?;
31232 __struct.yaw = buf.get_f32_le()?;
31233 __struct.yaw_rate = buf.get_f32_le()?;
31234 let tmp = buf.get_u16_le()?;
31235 __struct.type_mask =
31236 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
31237 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31238 flag_type: "PositionTargetTypemask",
31239 value: tmp as u64,
31240 })?;
31241 __struct.target_system = buf.get_u8()?;
31242 __struct.target_component = buf.get_u8()?;
31243 let tmp = buf.get_u8()?;
31244 __struct.coordinate_frame =
31245 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31246 enum_type: "MavFrame",
31247 value: tmp as u64,
31248 })?;
31249 Ok(__struct)
31250 }
31251 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31252 let mut __tmp = BytesMut::new(bytes);
31253 #[allow(clippy::absurd_extreme_comparisons)]
31254 #[allow(unused_comparisons)]
31255 if __tmp.remaining() < Self::ENCODED_LEN {
31256 panic!(
31257 "buffer is too small (need {} bytes, but got {})",
31258 Self::ENCODED_LEN,
31259 __tmp.remaining(),
31260 )
31261 }
31262 __tmp.put_u32_le(self.time_boot_ms);
31263 __tmp.put_f32_le(self.x);
31264 __tmp.put_f32_le(self.y);
31265 __tmp.put_f32_le(self.z);
31266 __tmp.put_f32_le(self.vx);
31267 __tmp.put_f32_le(self.vy);
31268 __tmp.put_f32_le(self.vz);
31269 __tmp.put_f32_le(self.afx);
31270 __tmp.put_f32_le(self.afy);
31271 __tmp.put_f32_le(self.afz);
31272 __tmp.put_f32_le(self.yaw);
31273 __tmp.put_f32_le(self.yaw_rate);
31274 __tmp.put_u16_le(self.type_mask.bits() as u16);
31275 __tmp.put_u8(self.target_system);
31276 __tmp.put_u8(self.target_component);
31277 __tmp.put_u8(self.coordinate_frame as u8);
31278 if matches!(version, MavlinkVersion::V2) {
31279 let len = __tmp.len();
31280 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31281 } else {
31282 __tmp.len()
31283 }
31284 }
31285}
31286#[doc = "Status of simulation environment, if used."]
31287#[doc = ""]
31288#[doc = "ID: 108"]
31289#[derive(Debug, Clone, PartialEq)]
31290#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31291#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31292#[cfg_attr(feature = "ts", derive(TS))]
31293#[cfg_attr(feature = "ts", ts(export))]
31294pub struct SIM_STATE_DATA {
31295 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
31296 pub q1: f32,
31297 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
31298 pub q2: f32,
31299 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
31300 pub q3: f32,
31301 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
31302 pub q4: f32,
31303 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
31304 pub roll: f32,
31305 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
31306 pub pitch: f32,
31307 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
31308 pub yaw: f32,
31309 #[doc = "X acceleration"]
31310 pub xacc: f32,
31311 #[doc = "Y acceleration"]
31312 pub yacc: f32,
31313 #[doc = "Z acceleration"]
31314 pub zacc: f32,
31315 #[doc = "Angular speed around X axis"]
31316 pub xgyro: f32,
31317 #[doc = "Angular speed around Y axis"]
31318 pub ygyro: f32,
31319 #[doc = "Angular speed around Z axis"]
31320 pub zgyro: f32,
31321 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
31322 pub lat: f32,
31323 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
31324 pub lon: f32,
31325 #[doc = "Altitude"]
31326 pub alt: f32,
31327 #[doc = "Horizontal position standard deviation"]
31328 pub std_dev_horz: f32,
31329 #[doc = "Vertical position standard deviation"]
31330 pub std_dev_vert: f32,
31331 #[doc = "True velocity in north direction in earth-fixed NED frame"]
31332 pub vn: f32,
31333 #[doc = "True velocity in east direction in earth-fixed NED frame"]
31334 pub ve: f32,
31335 #[doc = "True velocity in down direction in earth-fixed NED frame"]
31336 pub vd: f32,
31337 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
31338 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31339 pub lat_int: i32,
31340 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
31341 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31342 pub lon_int: i32,
31343}
31344impl SIM_STATE_DATA {
31345 pub const ENCODED_LEN: usize = 92usize;
31346 pub const DEFAULT: Self = Self {
31347 q1: 0.0_f32,
31348 q2: 0.0_f32,
31349 q3: 0.0_f32,
31350 q4: 0.0_f32,
31351 roll: 0.0_f32,
31352 pitch: 0.0_f32,
31353 yaw: 0.0_f32,
31354 xacc: 0.0_f32,
31355 yacc: 0.0_f32,
31356 zacc: 0.0_f32,
31357 xgyro: 0.0_f32,
31358 ygyro: 0.0_f32,
31359 zgyro: 0.0_f32,
31360 lat: 0.0_f32,
31361 lon: 0.0_f32,
31362 alt: 0.0_f32,
31363 std_dev_horz: 0.0_f32,
31364 std_dev_vert: 0.0_f32,
31365 vn: 0.0_f32,
31366 ve: 0.0_f32,
31367 vd: 0.0_f32,
31368 lat_int: 0_i32,
31369 lon_int: 0_i32,
31370 };
31371 #[cfg(feature = "arbitrary")]
31372 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31373 use arbitrary::{Arbitrary, Unstructured};
31374 let mut buf = [0u8; 1024];
31375 rng.fill_bytes(&mut buf);
31376 let mut unstructured = Unstructured::new(&buf);
31377 Self::arbitrary(&mut unstructured).unwrap_or_default()
31378 }
31379}
31380impl Default for SIM_STATE_DATA {
31381 fn default() -> Self {
31382 Self::DEFAULT.clone()
31383 }
31384}
31385impl MessageData for SIM_STATE_DATA {
31386 type Message = MavMessage;
31387 const ID: u32 = 108u32;
31388 const NAME: &'static str = "SIM_STATE";
31389 const EXTRA_CRC: u8 = 32u8;
31390 const ENCODED_LEN: usize = 92usize;
31391 fn deser(
31392 _version: MavlinkVersion,
31393 __input: &[u8],
31394 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31395 let avail_len = __input.len();
31396 let mut payload_buf = [0; Self::ENCODED_LEN];
31397 let mut buf = if avail_len < Self::ENCODED_LEN {
31398 payload_buf[0..avail_len].copy_from_slice(__input);
31399 Bytes::new(&payload_buf)
31400 } else {
31401 Bytes::new(__input)
31402 };
31403 let mut __struct = Self::default();
31404 __struct.q1 = buf.get_f32_le()?;
31405 __struct.q2 = buf.get_f32_le()?;
31406 __struct.q3 = buf.get_f32_le()?;
31407 __struct.q4 = buf.get_f32_le()?;
31408 __struct.roll = buf.get_f32_le()?;
31409 __struct.pitch = buf.get_f32_le()?;
31410 __struct.yaw = buf.get_f32_le()?;
31411 __struct.xacc = buf.get_f32_le()?;
31412 __struct.yacc = buf.get_f32_le()?;
31413 __struct.zacc = buf.get_f32_le()?;
31414 __struct.xgyro = buf.get_f32_le()?;
31415 __struct.ygyro = buf.get_f32_le()?;
31416 __struct.zgyro = buf.get_f32_le()?;
31417 __struct.lat = buf.get_f32_le()?;
31418 __struct.lon = buf.get_f32_le()?;
31419 __struct.alt = buf.get_f32_le()?;
31420 __struct.std_dev_horz = buf.get_f32_le()?;
31421 __struct.std_dev_vert = buf.get_f32_le()?;
31422 __struct.vn = buf.get_f32_le()?;
31423 __struct.ve = buf.get_f32_le()?;
31424 __struct.vd = buf.get_f32_le()?;
31425 __struct.lat_int = buf.get_i32_le()?;
31426 __struct.lon_int = buf.get_i32_le()?;
31427 Ok(__struct)
31428 }
31429 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31430 let mut __tmp = BytesMut::new(bytes);
31431 #[allow(clippy::absurd_extreme_comparisons)]
31432 #[allow(unused_comparisons)]
31433 if __tmp.remaining() < Self::ENCODED_LEN {
31434 panic!(
31435 "buffer is too small (need {} bytes, but got {})",
31436 Self::ENCODED_LEN,
31437 __tmp.remaining(),
31438 )
31439 }
31440 __tmp.put_f32_le(self.q1);
31441 __tmp.put_f32_le(self.q2);
31442 __tmp.put_f32_le(self.q3);
31443 __tmp.put_f32_le(self.q4);
31444 __tmp.put_f32_le(self.roll);
31445 __tmp.put_f32_le(self.pitch);
31446 __tmp.put_f32_le(self.yaw);
31447 __tmp.put_f32_le(self.xacc);
31448 __tmp.put_f32_le(self.yacc);
31449 __tmp.put_f32_le(self.zacc);
31450 __tmp.put_f32_le(self.xgyro);
31451 __tmp.put_f32_le(self.ygyro);
31452 __tmp.put_f32_le(self.zgyro);
31453 __tmp.put_f32_le(self.lat);
31454 __tmp.put_f32_le(self.lon);
31455 __tmp.put_f32_le(self.alt);
31456 __tmp.put_f32_le(self.std_dev_horz);
31457 __tmp.put_f32_le(self.std_dev_vert);
31458 __tmp.put_f32_le(self.vn);
31459 __tmp.put_f32_le(self.ve);
31460 __tmp.put_f32_le(self.vd);
31461 if matches!(version, MavlinkVersion::V2) {
31462 __tmp.put_i32_le(self.lat_int);
31463 __tmp.put_i32_le(self.lon_int);
31464 let len = __tmp.len();
31465 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31466 } else {
31467 __tmp.len()
31468 }
31469 }
31470}
31471#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
31472#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
31473#[doc = ""]
31474#[doc = "ID: 370"]
31475#[derive(Debug, Clone, PartialEq)]
31476#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31477#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31478#[cfg_attr(feature = "ts", derive(TS))]
31479#[cfg_attr(feature = "ts", ts(export))]
31480pub struct SMART_BATTERY_INFO_DATA {
31481 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
31482 pub capacity_full_specification: i32,
31483 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
31484 pub capacity_full: i32,
31485 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
31486 pub cycle_count: u16,
31487 #[doc = "Battery weight. 0: field not provided."]
31488 pub weight: u16,
31489 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
31490 pub discharge_minimum_voltage: u16,
31491 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
31492 pub charging_minimum_voltage: u16,
31493 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
31494 pub resting_minimum_voltage: u16,
31495 #[doc = "Battery ID"]
31496 pub id: u8,
31497 #[doc = "Function of the battery"]
31498 pub battery_function: MavBatteryFunction,
31499 #[doc = "Type (chemistry) of the battery"]
31500 pub mavtype: MavBatteryType,
31501 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
31502 #[cfg_attr(feature = "ts", ts(type = "string"))]
31503 pub serial_number: CharArray<16>,
31504 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
31505 #[cfg_attr(feature = "ts", ts(type = "string"))]
31506 pub device_name: CharArray<50>,
31507 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
31508 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31509 pub charging_maximum_voltage: u16,
31510 #[doc = "Number of battery cells in series. 0: field not provided."]
31511 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31512 pub cells_in_series: u8,
31513 #[doc = "Maximum pack discharge current. 0: field not provided."]
31514 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31515 pub discharge_maximum_current: u32,
31516 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
31517 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31518 pub discharge_maximum_burst_current: u32,
31519 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
31520 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31521 #[cfg_attr(feature = "ts", ts(type = "string"))]
31522 pub manufacture_date: CharArray<11>,
31523}
31524impl SMART_BATTERY_INFO_DATA {
31525 pub const ENCODED_LEN: usize = 109usize;
31526 pub const DEFAULT: Self = Self {
31527 capacity_full_specification: 0_i32,
31528 capacity_full: 0_i32,
31529 cycle_count: 0_u16,
31530 weight: 0_u16,
31531 discharge_minimum_voltage: 0_u16,
31532 charging_minimum_voltage: 0_u16,
31533 resting_minimum_voltage: 0_u16,
31534 id: 0_u8,
31535 battery_function: MavBatteryFunction::DEFAULT,
31536 mavtype: MavBatteryType::DEFAULT,
31537 serial_number: CharArray::new([0_u8; 16usize]),
31538 device_name: CharArray::new([0_u8; 50usize]),
31539 charging_maximum_voltage: 0_u16,
31540 cells_in_series: 0_u8,
31541 discharge_maximum_current: 0_u32,
31542 discharge_maximum_burst_current: 0_u32,
31543 manufacture_date: CharArray::new([0_u8; 11usize]),
31544 };
31545 #[cfg(feature = "arbitrary")]
31546 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31547 use arbitrary::{Arbitrary, Unstructured};
31548 let mut buf = [0u8; 1024];
31549 rng.fill_bytes(&mut buf);
31550 let mut unstructured = Unstructured::new(&buf);
31551 Self::arbitrary(&mut unstructured).unwrap_or_default()
31552 }
31553}
31554impl Default for SMART_BATTERY_INFO_DATA {
31555 fn default() -> Self {
31556 Self::DEFAULT.clone()
31557 }
31558}
31559impl MessageData for SMART_BATTERY_INFO_DATA {
31560 type Message = MavMessage;
31561 const ID: u32 = 370u32;
31562 const NAME: &'static str = "SMART_BATTERY_INFO";
31563 const EXTRA_CRC: u8 = 75u8;
31564 const ENCODED_LEN: usize = 109usize;
31565 fn deser(
31566 _version: MavlinkVersion,
31567 __input: &[u8],
31568 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31569 let avail_len = __input.len();
31570 let mut payload_buf = [0; Self::ENCODED_LEN];
31571 let mut buf = if avail_len < Self::ENCODED_LEN {
31572 payload_buf[0..avail_len].copy_from_slice(__input);
31573 Bytes::new(&payload_buf)
31574 } else {
31575 Bytes::new(__input)
31576 };
31577 let mut __struct = Self::default();
31578 __struct.capacity_full_specification = buf.get_i32_le()?;
31579 __struct.capacity_full = buf.get_i32_le()?;
31580 __struct.cycle_count = buf.get_u16_le()?;
31581 __struct.weight = buf.get_u16_le()?;
31582 __struct.discharge_minimum_voltage = buf.get_u16_le()?;
31583 __struct.charging_minimum_voltage = buf.get_u16_le()?;
31584 __struct.resting_minimum_voltage = buf.get_u16_le()?;
31585 __struct.id = buf.get_u8()?;
31586 let tmp = buf.get_u8()?;
31587 __struct.battery_function =
31588 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31589 enum_type: "MavBatteryFunction",
31590 value: tmp as u64,
31591 })?;
31592 let tmp = buf.get_u8()?;
31593 __struct.mavtype =
31594 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31595 enum_type: "MavBatteryType",
31596 value: tmp as u64,
31597 })?;
31598 let mut tmp = [0_u8; 16usize];
31599 for v in &mut tmp {
31600 *v = buf.get_u8()?;
31601 }
31602 __struct.serial_number = CharArray::new(tmp);
31603 let mut tmp = [0_u8; 50usize];
31604 for v in &mut tmp {
31605 *v = buf.get_u8()?;
31606 }
31607 __struct.device_name = CharArray::new(tmp);
31608 __struct.charging_maximum_voltage = buf.get_u16_le()?;
31609 __struct.cells_in_series = buf.get_u8()?;
31610 __struct.discharge_maximum_current = buf.get_u32_le()?;
31611 __struct.discharge_maximum_burst_current = buf.get_u32_le()?;
31612 let mut tmp = [0_u8; 11usize];
31613 for v in &mut tmp {
31614 *v = buf.get_u8()?;
31615 }
31616 __struct.manufacture_date = CharArray::new(tmp);
31617 Ok(__struct)
31618 }
31619 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31620 let mut __tmp = BytesMut::new(bytes);
31621 #[allow(clippy::absurd_extreme_comparisons)]
31622 #[allow(unused_comparisons)]
31623 if __tmp.remaining() < Self::ENCODED_LEN {
31624 panic!(
31625 "buffer is too small (need {} bytes, but got {})",
31626 Self::ENCODED_LEN,
31627 __tmp.remaining(),
31628 )
31629 }
31630 __tmp.put_i32_le(self.capacity_full_specification);
31631 __tmp.put_i32_le(self.capacity_full);
31632 __tmp.put_u16_le(self.cycle_count);
31633 __tmp.put_u16_le(self.weight);
31634 __tmp.put_u16_le(self.discharge_minimum_voltage);
31635 __tmp.put_u16_le(self.charging_minimum_voltage);
31636 __tmp.put_u16_le(self.resting_minimum_voltage);
31637 __tmp.put_u8(self.id);
31638 __tmp.put_u8(self.battery_function as u8);
31639 __tmp.put_u8(self.mavtype as u8);
31640 for val in &self.serial_number {
31641 __tmp.put_u8(*val);
31642 }
31643 for val in &self.device_name {
31644 __tmp.put_u8(*val);
31645 }
31646 if matches!(version, MavlinkVersion::V2) {
31647 __tmp.put_u16_le(self.charging_maximum_voltage);
31648 __tmp.put_u8(self.cells_in_series);
31649 __tmp.put_u32_le(self.discharge_maximum_current);
31650 __tmp.put_u32_le(self.discharge_maximum_burst_current);
31651 for val in &self.manufacture_date {
31652 __tmp.put_u8(*val);
31653 }
31654 let len = __tmp.len();
31655 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31656 } else {
31657 __tmp.len()
31658 }
31659 }
31660}
31661#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
31662#[doc = ""]
31663#[doc = "ID: 253"]
31664#[derive(Debug, Clone, PartialEq)]
31665#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31666#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31667#[cfg_attr(feature = "ts", derive(TS))]
31668#[cfg_attr(feature = "ts", ts(export))]
31669pub struct STATUSTEXT_DATA {
31670 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
31671 pub severity: MavSeverity,
31672 #[doc = "Status text message, without null termination character"]
31673 #[cfg_attr(feature = "ts", ts(type = "string"))]
31674 pub text: CharArray<50>,
31675 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
31676 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31677 pub id: u16,
31678 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
31679 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31680 pub chunk_seq: u8,
31681}
31682impl STATUSTEXT_DATA {
31683 pub const ENCODED_LEN: usize = 54usize;
31684 pub const DEFAULT: Self = Self {
31685 severity: MavSeverity::DEFAULT,
31686 text: CharArray::new([0_u8; 50usize]),
31687 id: 0_u16,
31688 chunk_seq: 0_u8,
31689 };
31690 #[cfg(feature = "arbitrary")]
31691 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31692 use arbitrary::{Arbitrary, Unstructured};
31693 let mut buf = [0u8; 1024];
31694 rng.fill_bytes(&mut buf);
31695 let mut unstructured = Unstructured::new(&buf);
31696 Self::arbitrary(&mut unstructured).unwrap_or_default()
31697 }
31698}
31699impl Default for STATUSTEXT_DATA {
31700 fn default() -> Self {
31701 Self::DEFAULT.clone()
31702 }
31703}
31704impl MessageData for STATUSTEXT_DATA {
31705 type Message = MavMessage;
31706 const ID: u32 = 253u32;
31707 const NAME: &'static str = "STATUSTEXT";
31708 const EXTRA_CRC: u8 = 83u8;
31709 const ENCODED_LEN: usize = 54usize;
31710 fn deser(
31711 _version: MavlinkVersion,
31712 __input: &[u8],
31713 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31714 let avail_len = __input.len();
31715 let mut payload_buf = [0; Self::ENCODED_LEN];
31716 let mut buf = if avail_len < Self::ENCODED_LEN {
31717 payload_buf[0..avail_len].copy_from_slice(__input);
31718 Bytes::new(&payload_buf)
31719 } else {
31720 Bytes::new(__input)
31721 };
31722 let mut __struct = Self::default();
31723 let tmp = buf.get_u8()?;
31724 __struct.severity =
31725 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31726 enum_type: "MavSeverity",
31727 value: tmp as u64,
31728 })?;
31729 let mut tmp = [0_u8; 50usize];
31730 for v in &mut tmp {
31731 *v = buf.get_u8()?;
31732 }
31733 __struct.text = CharArray::new(tmp);
31734 __struct.id = buf.get_u16_le()?;
31735 __struct.chunk_seq = buf.get_u8()?;
31736 Ok(__struct)
31737 }
31738 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31739 let mut __tmp = BytesMut::new(bytes);
31740 #[allow(clippy::absurd_extreme_comparisons)]
31741 #[allow(unused_comparisons)]
31742 if __tmp.remaining() < Self::ENCODED_LEN {
31743 panic!(
31744 "buffer is too small (need {} bytes, but got {})",
31745 Self::ENCODED_LEN,
31746 __tmp.remaining(),
31747 )
31748 }
31749 __tmp.put_u8(self.severity as u8);
31750 for val in &self.text {
31751 __tmp.put_u8(*val);
31752 }
31753 if matches!(version, MavlinkVersion::V2) {
31754 __tmp.put_u16_le(self.id);
31755 __tmp.put_u8(self.chunk_seq);
31756 let len = __tmp.len();
31757 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31758 } else {
31759 __tmp.len()
31760 }
31761 }
31762}
31763#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
31764#[doc = ""]
31765#[doc = "ID: 261"]
31766#[derive(Debug, Clone, PartialEq)]
31767#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31768#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31769#[cfg_attr(feature = "ts", derive(TS))]
31770#[cfg_attr(feature = "ts", ts(export))]
31771pub struct STORAGE_INFORMATION_DATA {
31772 #[doc = "Timestamp (time since system boot)."]
31773 pub time_boot_ms: u32,
31774 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
31775 pub total_capacity: f32,
31776 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
31777 pub used_capacity: f32,
31778 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
31779 pub available_capacity: f32,
31780 #[doc = "Read speed."]
31781 pub read_speed: f32,
31782 #[doc = "Write speed."]
31783 pub write_speed: f32,
31784 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
31785 pub storage_id: u8,
31786 #[doc = "Number of storage devices"]
31787 pub storage_count: u8,
31788 #[doc = "Status of storage"]
31789 pub status: StorageStatus,
31790 #[doc = "Type of storage"]
31791 #[cfg_attr(feature = "serde", serde(default))]
31792 pub mavtype: StorageType,
31793 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
31794 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31795 #[cfg_attr(feature = "ts", ts(type = "string"))]
31796 pub name: CharArray<32>,
31797 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
31798 #[cfg_attr(feature = "serde", serde(default))]
31799 pub storage_usage: StorageUsageFlag,
31800}
31801impl STORAGE_INFORMATION_DATA {
31802 pub const ENCODED_LEN: usize = 61usize;
31803 pub const DEFAULT: Self = Self {
31804 time_boot_ms: 0_u32,
31805 total_capacity: 0.0_f32,
31806 used_capacity: 0.0_f32,
31807 available_capacity: 0.0_f32,
31808 read_speed: 0.0_f32,
31809 write_speed: 0.0_f32,
31810 storage_id: 0_u8,
31811 storage_count: 0_u8,
31812 status: StorageStatus::DEFAULT,
31813 mavtype: StorageType::DEFAULT,
31814 name: CharArray::new([0_u8; 32usize]),
31815 storage_usage: StorageUsageFlag::DEFAULT,
31816 };
31817 #[cfg(feature = "arbitrary")]
31818 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31819 use arbitrary::{Arbitrary, Unstructured};
31820 let mut buf = [0u8; 1024];
31821 rng.fill_bytes(&mut buf);
31822 let mut unstructured = Unstructured::new(&buf);
31823 Self::arbitrary(&mut unstructured).unwrap_or_default()
31824 }
31825}
31826impl Default for STORAGE_INFORMATION_DATA {
31827 fn default() -> Self {
31828 Self::DEFAULT.clone()
31829 }
31830}
31831impl MessageData for STORAGE_INFORMATION_DATA {
31832 type Message = MavMessage;
31833 const ID: u32 = 261u32;
31834 const NAME: &'static str = "STORAGE_INFORMATION";
31835 const EXTRA_CRC: u8 = 179u8;
31836 const ENCODED_LEN: usize = 61usize;
31837 fn deser(
31838 _version: MavlinkVersion,
31839 __input: &[u8],
31840 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31841 let avail_len = __input.len();
31842 let mut payload_buf = [0; Self::ENCODED_LEN];
31843 let mut buf = if avail_len < Self::ENCODED_LEN {
31844 payload_buf[0..avail_len].copy_from_slice(__input);
31845 Bytes::new(&payload_buf)
31846 } else {
31847 Bytes::new(__input)
31848 };
31849 let mut __struct = Self::default();
31850 __struct.time_boot_ms = buf.get_u32_le()?;
31851 __struct.total_capacity = buf.get_f32_le()?;
31852 __struct.used_capacity = buf.get_f32_le()?;
31853 __struct.available_capacity = buf.get_f32_le()?;
31854 __struct.read_speed = buf.get_f32_le()?;
31855 __struct.write_speed = buf.get_f32_le()?;
31856 __struct.storage_id = buf.get_u8()?;
31857 __struct.storage_count = buf.get_u8()?;
31858 let tmp = buf.get_u8()?;
31859 __struct.status =
31860 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31861 enum_type: "StorageStatus",
31862 value: tmp as u64,
31863 })?;
31864 let tmp = buf.get_u8()?;
31865 __struct.mavtype =
31866 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31867 enum_type: "StorageType",
31868 value: tmp as u64,
31869 })?;
31870 let mut tmp = [0_u8; 32usize];
31871 for v in &mut tmp {
31872 *v = buf.get_u8()?;
31873 }
31874 __struct.name = CharArray::new(tmp);
31875 let tmp = buf.get_u8()?;
31876 __struct.storage_usage = StorageUsageFlag::from_bits(
31877 tmp as <StorageUsageFlag as Flags>::Bits,
31878 )
31879 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31880 flag_type: "StorageUsageFlag",
31881 value: tmp as u64,
31882 })?;
31883 Ok(__struct)
31884 }
31885 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31886 let mut __tmp = BytesMut::new(bytes);
31887 #[allow(clippy::absurd_extreme_comparisons)]
31888 #[allow(unused_comparisons)]
31889 if __tmp.remaining() < Self::ENCODED_LEN {
31890 panic!(
31891 "buffer is too small (need {} bytes, but got {})",
31892 Self::ENCODED_LEN,
31893 __tmp.remaining(),
31894 )
31895 }
31896 __tmp.put_u32_le(self.time_boot_ms);
31897 __tmp.put_f32_le(self.total_capacity);
31898 __tmp.put_f32_le(self.used_capacity);
31899 __tmp.put_f32_le(self.available_capacity);
31900 __tmp.put_f32_le(self.read_speed);
31901 __tmp.put_f32_le(self.write_speed);
31902 __tmp.put_u8(self.storage_id);
31903 __tmp.put_u8(self.storage_count);
31904 __tmp.put_u8(self.status as u8);
31905 if matches!(version, MavlinkVersion::V2) {
31906 __tmp.put_u8(self.mavtype as u8);
31907 for val in &self.name {
31908 __tmp.put_u8(*val);
31909 }
31910 __tmp.put_u8(self.storage_usage.bits() as u8);
31911 let len = __tmp.len();
31912 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31913 } else {
31914 __tmp.len()
31915 }
31916 }
31917}
31918#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
31919#[doc = ""]
31920#[doc = "ID: 401"]
31921#[derive(Debug, Clone, PartialEq)]
31922#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31923#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31924#[cfg_attr(feature = "ts", derive(TS))]
31925#[cfg_attr(feature = "ts", ts(export))]
31926pub struct SUPPORTED_TUNES_DATA {
31927 #[doc = "Bitfield of supported tune formats."]
31928 pub format: TuneFormat,
31929 #[doc = "System ID"]
31930 pub target_system: u8,
31931 #[doc = "Component ID"]
31932 pub target_component: u8,
31933}
31934impl SUPPORTED_TUNES_DATA {
31935 pub const ENCODED_LEN: usize = 6usize;
31936 pub const DEFAULT: Self = Self {
31937 format: TuneFormat::DEFAULT,
31938 target_system: 0_u8,
31939 target_component: 0_u8,
31940 };
31941 #[cfg(feature = "arbitrary")]
31942 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31943 use arbitrary::{Arbitrary, Unstructured};
31944 let mut buf = [0u8; 1024];
31945 rng.fill_bytes(&mut buf);
31946 let mut unstructured = Unstructured::new(&buf);
31947 Self::arbitrary(&mut unstructured).unwrap_or_default()
31948 }
31949}
31950impl Default for SUPPORTED_TUNES_DATA {
31951 fn default() -> Self {
31952 Self::DEFAULT.clone()
31953 }
31954}
31955impl MessageData for SUPPORTED_TUNES_DATA {
31956 type Message = MavMessage;
31957 const ID: u32 = 401u32;
31958 const NAME: &'static str = "SUPPORTED_TUNES";
31959 const EXTRA_CRC: u8 = 183u8;
31960 const ENCODED_LEN: usize = 6usize;
31961 fn deser(
31962 _version: MavlinkVersion,
31963 __input: &[u8],
31964 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31965 let avail_len = __input.len();
31966 let mut payload_buf = [0; Self::ENCODED_LEN];
31967 let mut buf = if avail_len < Self::ENCODED_LEN {
31968 payload_buf[0..avail_len].copy_from_slice(__input);
31969 Bytes::new(&payload_buf)
31970 } else {
31971 Bytes::new(__input)
31972 };
31973 let mut __struct = Self::default();
31974 let tmp = buf.get_u32_le()?;
31975 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
31976 ::mavlink_core::error::ParserError::InvalidEnum {
31977 enum_type: "TuneFormat",
31978 value: tmp as u64,
31979 },
31980 )?;
31981 __struct.target_system = buf.get_u8()?;
31982 __struct.target_component = buf.get_u8()?;
31983 Ok(__struct)
31984 }
31985 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31986 let mut __tmp = BytesMut::new(bytes);
31987 #[allow(clippy::absurd_extreme_comparisons)]
31988 #[allow(unused_comparisons)]
31989 if __tmp.remaining() < Self::ENCODED_LEN {
31990 panic!(
31991 "buffer is too small (need {} bytes, but got {})",
31992 Self::ENCODED_LEN,
31993 __tmp.remaining(),
31994 )
31995 }
31996 __tmp.put_u32_le(self.format as u32);
31997 __tmp.put_u8(self.target_system);
31998 __tmp.put_u8(self.target_component);
31999 if matches!(version, MavlinkVersion::V2) {
32000 let len = __tmp.len();
32001 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32002 } else {
32003 __tmp.len()
32004 }
32005 }
32006}
32007#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
32008#[doc = ""]
32009#[doc = "ID: 2"]
32010#[derive(Debug, Clone, PartialEq)]
32011#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32012#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32013#[cfg_attr(feature = "ts", derive(TS))]
32014#[cfg_attr(feature = "ts", ts(export))]
32015pub struct SYSTEM_TIME_DATA {
32016 #[doc = "Timestamp (UNIX epoch time)."]
32017 pub time_unix_usec: u64,
32018 #[doc = "Timestamp (time since system boot)."]
32019 pub time_boot_ms: u32,
32020}
32021impl SYSTEM_TIME_DATA {
32022 pub const ENCODED_LEN: usize = 12usize;
32023 pub const DEFAULT: Self = Self {
32024 time_unix_usec: 0_u64,
32025 time_boot_ms: 0_u32,
32026 };
32027 #[cfg(feature = "arbitrary")]
32028 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32029 use arbitrary::{Arbitrary, Unstructured};
32030 let mut buf = [0u8; 1024];
32031 rng.fill_bytes(&mut buf);
32032 let mut unstructured = Unstructured::new(&buf);
32033 Self::arbitrary(&mut unstructured).unwrap_or_default()
32034 }
32035}
32036impl Default for SYSTEM_TIME_DATA {
32037 fn default() -> Self {
32038 Self::DEFAULT.clone()
32039 }
32040}
32041impl MessageData for SYSTEM_TIME_DATA {
32042 type Message = MavMessage;
32043 const ID: u32 = 2u32;
32044 const NAME: &'static str = "SYSTEM_TIME";
32045 const EXTRA_CRC: u8 = 137u8;
32046 const ENCODED_LEN: usize = 12usize;
32047 fn deser(
32048 _version: MavlinkVersion,
32049 __input: &[u8],
32050 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32051 let avail_len = __input.len();
32052 let mut payload_buf = [0; Self::ENCODED_LEN];
32053 let mut buf = if avail_len < Self::ENCODED_LEN {
32054 payload_buf[0..avail_len].copy_from_slice(__input);
32055 Bytes::new(&payload_buf)
32056 } else {
32057 Bytes::new(__input)
32058 };
32059 let mut __struct = Self::default();
32060 __struct.time_unix_usec = buf.get_u64_le()?;
32061 __struct.time_boot_ms = buf.get_u32_le()?;
32062 Ok(__struct)
32063 }
32064 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32065 let mut __tmp = BytesMut::new(bytes);
32066 #[allow(clippy::absurd_extreme_comparisons)]
32067 #[allow(unused_comparisons)]
32068 if __tmp.remaining() < Self::ENCODED_LEN {
32069 panic!(
32070 "buffer is too small (need {} bytes, but got {})",
32071 Self::ENCODED_LEN,
32072 __tmp.remaining(),
32073 )
32074 }
32075 __tmp.put_u64_le(self.time_unix_usec);
32076 __tmp.put_u32_le(self.time_boot_ms);
32077 if matches!(version, MavlinkVersion::V2) {
32078 let len = __tmp.len();
32079 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32080 } else {
32081 __tmp.len()
32082 }
32083 }
32084}
32085#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
32086#[doc = ""]
32087#[doc = "ID: 1"]
32088#[derive(Debug, Clone, PartialEq)]
32089#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32090#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32091#[cfg_attr(feature = "ts", derive(TS))]
32092#[cfg_attr(feature = "ts", ts(export))]
32093pub struct SYS_STATUS_DATA {
32094 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
32095 pub onboard_control_sensors_present: MavSysStatusSensor,
32096 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
32097 pub onboard_control_sensors_enabled: MavSysStatusSensor,
32098 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
32099 pub onboard_control_sensors_health: MavSysStatusSensor,
32100 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
32101 pub load: u16,
32102 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
32103 pub voltage_battery: u16,
32104 #[doc = "Battery current, -1: Current not sent by autopilot"]
32105 pub current_battery: i16,
32106 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
32107 pub drop_rate_comm: u16,
32108 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
32109 pub errors_comm: u16,
32110 #[doc = "Autopilot-specific errors"]
32111 pub errors_count1: u16,
32112 #[doc = "Autopilot-specific errors"]
32113 pub errors_count2: u16,
32114 #[doc = "Autopilot-specific errors"]
32115 pub errors_count3: u16,
32116 #[doc = "Autopilot-specific errors"]
32117 pub errors_count4: u16,
32118 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
32119 pub battery_remaining: i8,
32120 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
32121 #[cfg_attr(feature = "serde", serde(default))]
32122 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
32123 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
32124 #[cfg_attr(feature = "serde", serde(default))]
32125 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
32126 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
32127 #[cfg_attr(feature = "serde", serde(default))]
32128 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
32129}
32130impl SYS_STATUS_DATA {
32131 pub const ENCODED_LEN: usize = 43usize;
32132 pub const DEFAULT: Self = Self {
32133 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
32134 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
32135 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
32136 load: 0_u16,
32137 voltage_battery: 0_u16,
32138 current_battery: 0_i16,
32139 drop_rate_comm: 0_u16,
32140 errors_comm: 0_u16,
32141 errors_count1: 0_u16,
32142 errors_count2: 0_u16,
32143 errors_count3: 0_u16,
32144 errors_count4: 0_u16,
32145 battery_remaining: 0_i8,
32146 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
32147 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
32148 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
32149 };
32150 #[cfg(feature = "arbitrary")]
32151 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32152 use arbitrary::{Arbitrary, Unstructured};
32153 let mut buf = [0u8; 1024];
32154 rng.fill_bytes(&mut buf);
32155 let mut unstructured = Unstructured::new(&buf);
32156 Self::arbitrary(&mut unstructured).unwrap_or_default()
32157 }
32158}
32159impl Default for SYS_STATUS_DATA {
32160 fn default() -> Self {
32161 Self::DEFAULT.clone()
32162 }
32163}
32164impl MessageData for SYS_STATUS_DATA {
32165 type Message = MavMessage;
32166 const ID: u32 = 1u32;
32167 const NAME: &'static str = "SYS_STATUS";
32168 const EXTRA_CRC: u8 = 124u8;
32169 const ENCODED_LEN: usize = 43usize;
32170 fn deser(
32171 _version: MavlinkVersion,
32172 __input: &[u8],
32173 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32174 let avail_len = __input.len();
32175 let mut payload_buf = [0; Self::ENCODED_LEN];
32176 let mut buf = if avail_len < Self::ENCODED_LEN {
32177 payload_buf[0..avail_len].copy_from_slice(__input);
32178 Bytes::new(&payload_buf)
32179 } else {
32180 Bytes::new(__input)
32181 };
32182 let mut __struct = Self::default();
32183 let tmp = buf.get_u32_le()?;
32184 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
32185 tmp as <MavSysStatusSensor as Flags>::Bits,
32186 )
32187 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32188 flag_type: "MavSysStatusSensor",
32189 value: tmp as u64,
32190 })?;
32191 let tmp = buf.get_u32_le()?;
32192 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
32193 tmp as <MavSysStatusSensor as Flags>::Bits,
32194 )
32195 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32196 flag_type: "MavSysStatusSensor",
32197 value: tmp as u64,
32198 })?;
32199 let tmp = buf.get_u32_le()?;
32200 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
32201 tmp as <MavSysStatusSensor as Flags>::Bits,
32202 )
32203 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32204 flag_type: "MavSysStatusSensor",
32205 value: tmp as u64,
32206 })?;
32207 __struct.load = buf.get_u16_le()?;
32208 __struct.voltage_battery = buf.get_u16_le()?;
32209 __struct.current_battery = buf.get_i16_le()?;
32210 __struct.drop_rate_comm = buf.get_u16_le()?;
32211 __struct.errors_comm = buf.get_u16_le()?;
32212 __struct.errors_count1 = buf.get_u16_le()?;
32213 __struct.errors_count2 = buf.get_u16_le()?;
32214 __struct.errors_count3 = buf.get_u16_le()?;
32215 __struct.errors_count4 = buf.get_u16_le()?;
32216 __struct.battery_remaining = buf.get_i8()?;
32217 let tmp = buf.get_u32_le()?;
32218 __struct.onboard_control_sensors_present_extended = MavSysStatusSensorExtended::from_bits(
32219 tmp as <MavSysStatusSensorExtended as Flags>::Bits,
32220 )
32221 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32222 flag_type: "MavSysStatusSensorExtended",
32223 value: tmp as u64,
32224 })?;
32225 let tmp = buf.get_u32_le()?;
32226 __struct.onboard_control_sensors_enabled_extended = MavSysStatusSensorExtended::from_bits(
32227 tmp as <MavSysStatusSensorExtended as Flags>::Bits,
32228 )
32229 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32230 flag_type: "MavSysStatusSensorExtended",
32231 value: tmp as u64,
32232 })?;
32233 let tmp = buf.get_u32_le()?;
32234 __struct.onboard_control_sensors_health_extended = MavSysStatusSensorExtended::from_bits(
32235 tmp as <MavSysStatusSensorExtended as Flags>::Bits,
32236 )
32237 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32238 flag_type: "MavSysStatusSensorExtended",
32239 value: tmp as u64,
32240 })?;
32241 Ok(__struct)
32242 }
32243 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32244 let mut __tmp = BytesMut::new(bytes);
32245 #[allow(clippy::absurd_extreme_comparisons)]
32246 #[allow(unused_comparisons)]
32247 if __tmp.remaining() < Self::ENCODED_LEN {
32248 panic!(
32249 "buffer is too small (need {} bytes, but got {})",
32250 Self::ENCODED_LEN,
32251 __tmp.remaining(),
32252 )
32253 }
32254 __tmp.put_u32_le(self.onboard_control_sensors_present.bits() as u32);
32255 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits() as u32);
32256 __tmp.put_u32_le(self.onboard_control_sensors_health.bits() as u32);
32257 __tmp.put_u16_le(self.load);
32258 __tmp.put_u16_le(self.voltage_battery);
32259 __tmp.put_i16_le(self.current_battery);
32260 __tmp.put_u16_le(self.drop_rate_comm);
32261 __tmp.put_u16_le(self.errors_comm);
32262 __tmp.put_u16_le(self.errors_count1);
32263 __tmp.put_u16_le(self.errors_count2);
32264 __tmp.put_u16_le(self.errors_count3);
32265 __tmp.put_u16_le(self.errors_count4);
32266 __tmp.put_i8(self.battery_remaining);
32267 if matches!(version, MavlinkVersion::V2) {
32268 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits() as u32);
32269 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits() as u32);
32270 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits() as u32);
32271 let len = __tmp.len();
32272 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32273 } else {
32274 __tmp.len()
32275 }
32276 }
32277}
32278#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
32279#[doc = ""]
32280#[doc = "ID: 135"]
32281#[derive(Debug, Clone, PartialEq)]
32282#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32283#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32284#[cfg_attr(feature = "ts", derive(TS))]
32285#[cfg_attr(feature = "ts", ts(export))]
32286pub struct TERRAIN_CHECK_DATA {
32287 #[doc = "Latitude"]
32288 pub lat: i32,
32289 #[doc = "Longitude"]
32290 pub lon: i32,
32291}
32292impl TERRAIN_CHECK_DATA {
32293 pub const ENCODED_LEN: usize = 8usize;
32294 pub const DEFAULT: Self = Self {
32295 lat: 0_i32,
32296 lon: 0_i32,
32297 };
32298 #[cfg(feature = "arbitrary")]
32299 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32300 use arbitrary::{Arbitrary, Unstructured};
32301 let mut buf = [0u8; 1024];
32302 rng.fill_bytes(&mut buf);
32303 let mut unstructured = Unstructured::new(&buf);
32304 Self::arbitrary(&mut unstructured).unwrap_or_default()
32305 }
32306}
32307impl Default for TERRAIN_CHECK_DATA {
32308 fn default() -> Self {
32309 Self::DEFAULT.clone()
32310 }
32311}
32312impl MessageData for TERRAIN_CHECK_DATA {
32313 type Message = MavMessage;
32314 const ID: u32 = 135u32;
32315 const NAME: &'static str = "TERRAIN_CHECK";
32316 const EXTRA_CRC: u8 = 203u8;
32317 const ENCODED_LEN: usize = 8usize;
32318 fn deser(
32319 _version: MavlinkVersion,
32320 __input: &[u8],
32321 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32322 let avail_len = __input.len();
32323 let mut payload_buf = [0; Self::ENCODED_LEN];
32324 let mut buf = if avail_len < Self::ENCODED_LEN {
32325 payload_buf[0..avail_len].copy_from_slice(__input);
32326 Bytes::new(&payload_buf)
32327 } else {
32328 Bytes::new(__input)
32329 };
32330 let mut __struct = Self::default();
32331 __struct.lat = buf.get_i32_le()?;
32332 __struct.lon = buf.get_i32_le()?;
32333 Ok(__struct)
32334 }
32335 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32336 let mut __tmp = BytesMut::new(bytes);
32337 #[allow(clippy::absurd_extreme_comparisons)]
32338 #[allow(unused_comparisons)]
32339 if __tmp.remaining() < Self::ENCODED_LEN {
32340 panic!(
32341 "buffer is too small (need {} bytes, but got {})",
32342 Self::ENCODED_LEN,
32343 __tmp.remaining(),
32344 )
32345 }
32346 __tmp.put_i32_le(self.lat);
32347 __tmp.put_i32_le(self.lon);
32348 if matches!(version, MavlinkVersion::V2) {
32349 let len = __tmp.len();
32350 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32351 } else {
32352 __tmp.len()
32353 }
32354 }
32355}
32356#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
32357#[doc = ""]
32358#[doc = "ID: 134"]
32359#[derive(Debug, Clone, PartialEq)]
32360#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32361#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32362#[cfg_attr(feature = "ts", derive(TS))]
32363#[cfg_attr(feature = "ts", ts(export))]
32364pub struct TERRAIN_DATA_DATA {
32365 #[doc = "Latitude of SW corner of first grid"]
32366 pub lat: i32,
32367 #[doc = "Longitude of SW corner of first grid"]
32368 pub lon: i32,
32369 #[doc = "Grid spacing"]
32370 pub grid_spacing: u16,
32371 #[doc = "Terrain data MSL"]
32372 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32373 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32374 pub data: [i16; 16],
32375 #[doc = "bit within the terrain request mask"]
32376 pub gridbit: u8,
32377}
32378impl TERRAIN_DATA_DATA {
32379 pub const ENCODED_LEN: usize = 43usize;
32380 pub const DEFAULT: Self = Self {
32381 lat: 0_i32,
32382 lon: 0_i32,
32383 grid_spacing: 0_u16,
32384 data: [0_i16; 16usize],
32385 gridbit: 0_u8,
32386 };
32387 #[cfg(feature = "arbitrary")]
32388 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32389 use arbitrary::{Arbitrary, Unstructured};
32390 let mut buf = [0u8; 1024];
32391 rng.fill_bytes(&mut buf);
32392 let mut unstructured = Unstructured::new(&buf);
32393 Self::arbitrary(&mut unstructured).unwrap_or_default()
32394 }
32395}
32396impl Default for TERRAIN_DATA_DATA {
32397 fn default() -> Self {
32398 Self::DEFAULT.clone()
32399 }
32400}
32401impl MessageData for TERRAIN_DATA_DATA {
32402 type Message = MavMessage;
32403 const ID: u32 = 134u32;
32404 const NAME: &'static str = "TERRAIN_DATA";
32405 const EXTRA_CRC: u8 = 229u8;
32406 const ENCODED_LEN: usize = 43usize;
32407 fn deser(
32408 _version: MavlinkVersion,
32409 __input: &[u8],
32410 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32411 let avail_len = __input.len();
32412 let mut payload_buf = [0; Self::ENCODED_LEN];
32413 let mut buf = if avail_len < Self::ENCODED_LEN {
32414 payload_buf[0..avail_len].copy_from_slice(__input);
32415 Bytes::new(&payload_buf)
32416 } else {
32417 Bytes::new(__input)
32418 };
32419 let mut __struct = Self::default();
32420 __struct.lat = buf.get_i32_le()?;
32421 __struct.lon = buf.get_i32_le()?;
32422 __struct.grid_spacing = buf.get_u16_le()?;
32423 for v in &mut __struct.data {
32424 let val = buf.get_i16_le()?;
32425 *v = val;
32426 }
32427 __struct.gridbit = buf.get_u8()?;
32428 Ok(__struct)
32429 }
32430 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32431 let mut __tmp = BytesMut::new(bytes);
32432 #[allow(clippy::absurd_extreme_comparisons)]
32433 #[allow(unused_comparisons)]
32434 if __tmp.remaining() < Self::ENCODED_LEN {
32435 panic!(
32436 "buffer is too small (need {} bytes, but got {})",
32437 Self::ENCODED_LEN,
32438 __tmp.remaining(),
32439 )
32440 }
32441 __tmp.put_i32_le(self.lat);
32442 __tmp.put_i32_le(self.lon);
32443 __tmp.put_u16_le(self.grid_spacing);
32444 for val in &self.data {
32445 __tmp.put_i16_le(*val);
32446 }
32447 __tmp.put_u8(self.gridbit);
32448 if matches!(version, MavlinkVersion::V2) {
32449 let len = __tmp.len();
32450 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32451 } else {
32452 __tmp.len()
32453 }
32454 }
32455}
32456#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
32457#[doc = ""]
32458#[doc = "ID: 136"]
32459#[derive(Debug, Clone, PartialEq)]
32460#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32461#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32462#[cfg_attr(feature = "ts", derive(TS))]
32463#[cfg_attr(feature = "ts", ts(export))]
32464pub struct TERRAIN_REPORT_DATA {
32465 #[doc = "Latitude"]
32466 pub lat: i32,
32467 #[doc = "Longitude"]
32468 pub lon: i32,
32469 #[doc = "Terrain height MSL"]
32470 pub terrain_height: f32,
32471 #[doc = "Current vehicle height above lat/lon terrain height"]
32472 pub current_height: f32,
32473 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
32474 pub spacing: u16,
32475 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
32476 pub pending: u16,
32477 #[doc = "Number of 4x4 terrain blocks in memory"]
32478 pub loaded: u16,
32479}
32480impl TERRAIN_REPORT_DATA {
32481 pub const ENCODED_LEN: usize = 22usize;
32482 pub const DEFAULT: Self = Self {
32483 lat: 0_i32,
32484 lon: 0_i32,
32485 terrain_height: 0.0_f32,
32486 current_height: 0.0_f32,
32487 spacing: 0_u16,
32488 pending: 0_u16,
32489 loaded: 0_u16,
32490 };
32491 #[cfg(feature = "arbitrary")]
32492 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32493 use arbitrary::{Arbitrary, Unstructured};
32494 let mut buf = [0u8; 1024];
32495 rng.fill_bytes(&mut buf);
32496 let mut unstructured = Unstructured::new(&buf);
32497 Self::arbitrary(&mut unstructured).unwrap_or_default()
32498 }
32499}
32500impl Default for TERRAIN_REPORT_DATA {
32501 fn default() -> Self {
32502 Self::DEFAULT.clone()
32503 }
32504}
32505impl MessageData for TERRAIN_REPORT_DATA {
32506 type Message = MavMessage;
32507 const ID: u32 = 136u32;
32508 const NAME: &'static str = "TERRAIN_REPORT";
32509 const EXTRA_CRC: u8 = 1u8;
32510 const ENCODED_LEN: usize = 22usize;
32511 fn deser(
32512 _version: MavlinkVersion,
32513 __input: &[u8],
32514 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32515 let avail_len = __input.len();
32516 let mut payload_buf = [0; Self::ENCODED_LEN];
32517 let mut buf = if avail_len < Self::ENCODED_LEN {
32518 payload_buf[0..avail_len].copy_from_slice(__input);
32519 Bytes::new(&payload_buf)
32520 } else {
32521 Bytes::new(__input)
32522 };
32523 let mut __struct = Self::default();
32524 __struct.lat = buf.get_i32_le()?;
32525 __struct.lon = buf.get_i32_le()?;
32526 __struct.terrain_height = buf.get_f32_le()?;
32527 __struct.current_height = buf.get_f32_le()?;
32528 __struct.spacing = buf.get_u16_le()?;
32529 __struct.pending = buf.get_u16_le()?;
32530 __struct.loaded = buf.get_u16_le()?;
32531 Ok(__struct)
32532 }
32533 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32534 let mut __tmp = BytesMut::new(bytes);
32535 #[allow(clippy::absurd_extreme_comparisons)]
32536 #[allow(unused_comparisons)]
32537 if __tmp.remaining() < Self::ENCODED_LEN {
32538 panic!(
32539 "buffer is too small (need {} bytes, but got {})",
32540 Self::ENCODED_LEN,
32541 __tmp.remaining(),
32542 )
32543 }
32544 __tmp.put_i32_le(self.lat);
32545 __tmp.put_i32_le(self.lon);
32546 __tmp.put_f32_le(self.terrain_height);
32547 __tmp.put_f32_le(self.current_height);
32548 __tmp.put_u16_le(self.spacing);
32549 __tmp.put_u16_le(self.pending);
32550 __tmp.put_u16_le(self.loaded);
32551 if matches!(version, MavlinkVersion::V2) {
32552 let len = __tmp.len();
32553 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32554 } else {
32555 __tmp.len()
32556 }
32557 }
32558}
32559#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
32560#[doc = ""]
32561#[doc = "ID: 133"]
32562#[derive(Debug, Clone, PartialEq)]
32563#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32564#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32565#[cfg_attr(feature = "ts", derive(TS))]
32566#[cfg_attr(feature = "ts", ts(export))]
32567pub struct TERRAIN_REQUEST_DATA {
32568 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
32569 pub mask: u64,
32570 #[doc = "Latitude of SW corner of first grid"]
32571 pub lat: i32,
32572 #[doc = "Longitude of SW corner of first grid"]
32573 pub lon: i32,
32574 #[doc = "Grid spacing"]
32575 pub grid_spacing: u16,
32576}
32577impl TERRAIN_REQUEST_DATA {
32578 pub const ENCODED_LEN: usize = 18usize;
32579 pub const DEFAULT: Self = Self {
32580 mask: 0_u64,
32581 lat: 0_i32,
32582 lon: 0_i32,
32583 grid_spacing: 0_u16,
32584 };
32585 #[cfg(feature = "arbitrary")]
32586 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32587 use arbitrary::{Arbitrary, Unstructured};
32588 let mut buf = [0u8; 1024];
32589 rng.fill_bytes(&mut buf);
32590 let mut unstructured = Unstructured::new(&buf);
32591 Self::arbitrary(&mut unstructured).unwrap_or_default()
32592 }
32593}
32594impl Default for TERRAIN_REQUEST_DATA {
32595 fn default() -> Self {
32596 Self::DEFAULT.clone()
32597 }
32598}
32599impl MessageData for TERRAIN_REQUEST_DATA {
32600 type Message = MavMessage;
32601 const ID: u32 = 133u32;
32602 const NAME: &'static str = "TERRAIN_REQUEST";
32603 const EXTRA_CRC: u8 = 6u8;
32604 const ENCODED_LEN: usize = 18usize;
32605 fn deser(
32606 _version: MavlinkVersion,
32607 __input: &[u8],
32608 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32609 let avail_len = __input.len();
32610 let mut payload_buf = [0; Self::ENCODED_LEN];
32611 let mut buf = if avail_len < Self::ENCODED_LEN {
32612 payload_buf[0..avail_len].copy_from_slice(__input);
32613 Bytes::new(&payload_buf)
32614 } else {
32615 Bytes::new(__input)
32616 };
32617 let mut __struct = Self::default();
32618 __struct.mask = buf.get_u64_le()?;
32619 __struct.lat = buf.get_i32_le()?;
32620 __struct.lon = buf.get_i32_le()?;
32621 __struct.grid_spacing = buf.get_u16_le()?;
32622 Ok(__struct)
32623 }
32624 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32625 let mut __tmp = BytesMut::new(bytes);
32626 #[allow(clippy::absurd_extreme_comparisons)]
32627 #[allow(unused_comparisons)]
32628 if __tmp.remaining() < Self::ENCODED_LEN {
32629 panic!(
32630 "buffer is too small (need {} bytes, but got {})",
32631 Self::ENCODED_LEN,
32632 __tmp.remaining(),
32633 )
32634 }
32635 __tmp.put_u64_le(self.mask);
32636 __tmp.put_i32_le(self.lat);
32637 __tmp.put_i32_le(self.lon);
32638 __tmp.put_u16_le(self.grid_spacing);
32639 if matches!(version, MavlinkVersion::V2) {
32640 let len = __tmp.len();
32641 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32642 } else {
32643 __tmp.len()
32644 }
32645 }
32646}
32647#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
32648#[doc = ""]
32649#[doc = "ID: 111"]
32650#[derive(Debug, Clone, PartialEq)]
32651#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32652#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32653#[cfg_attr(feature = "ts", derive(TS))]
32654#[cfg_attr(feature = "ts", ts(export))]
32655pub struct TIMESYNC_DATA {
32656 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
32657 pub tc1: i64,
32658 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
32659 pub ts1: i64,
32660 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
32661 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32662 pub target_system: u8,
32663 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
32664 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32665 pub target_component: u8,
32666}
32667impl TIMESYNC_DATA {
32668 pub const ENCODED_LEN: usize = 18usize;
32669 pub const DEFAULT: Self = Self {
32670 tc1: 0_i64,
32671 ts1: 0_i64,
32672 target_system: 0_u8,
32673 target_component: 0_u8,
32674 };
32675 #[cfg(feature = "arbitrary")]
32676 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32677 use arbitrary::{Arbitrary, Unstructured};
32678 let mut buf = [0u8; 1024];
32679 rng.fill_bytes(&mut buf);
32680 let mut unstructured = Unstructured::new(&buf);
32681 Self::arbitrary(&mut unstructured).unwrap_or_default()
32682 }
32683}
32684impl Default for TIMESYNC_DATA {
32685 fn default() -> Self {
32686 Self::DEFAULT.clone()
32687 }
32688}
32689impl MessageData for TIMESYNC_DATA {
32690 type Message = MavMessage;
32691 const ID: u32 = 111u32;
32692 const NAME: &'static str = "TIMESYNC";
32693 const EXTRA_CRC: u8 = 34u8;
32694 const ENCODED_LEN: usize = 18usize;
32695 fn deser(
32696 _version: MavlinkVersion,
32697 __input: &[u8],
32698 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32699 let avail_len = __input.len();
32700 let mut payload_buf = [0; Self::ENCODED_LEN];
32701 let mut buf = if avail_len < Self::ENCODED_LEN {
32702 payload_buf[0..avail_len].copy_from_slice(__input);
32703 Bytes::new(&payload_buf)
32704 } else {
32705 Bytes::new(__input)
32706 };
32707 let mut __struct = Self::default();
32708 __struct.tc1 = buf.get_i64_le()?;
32709 __struct.ts1 = buf.get_i64_le()?;
32710 __struct.target_system = buf.get_u8()?;
32711 __struct.target_component = buf.get_u8()?;
32712 Ok(__struct)
32713 }
32714 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32715 let mut __tmp = BytesMut::new(bytes);
32716 #[allow(clippy::absurd_extreme_comparisons)]
32717 #[allow(unused_comparisons)]
32718 if __tmp.remaining() < Self::ENCODED_LEN {
32719 panic!(
32720 "buffer is too small (need {} bytes, but got {})",
32721 Self::ENCODED_LEN,
32722 __tmp.remaining(),
32723 )
32724 }
32725 __tmp.put_i64_le(self.tc1);
32726 __tmp.put_i64_le(self.ts1);
32727 if matches!(version, MavlinkVersion::V2) {
32728 __tmp.put_u8(self.target_system);
32729 __tmp.put_u8(self.target_component);
32730 let len = __tmp.len();
32731 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32732 } else {
32733 __tmp.len()
32734 }
32735 }
32736}
32737#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
32738#[doc = ""]
32739#[doc = "ID: 380"]
32740#[derive(Debug, Clone, PartialEq)]
32741#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32742#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32743#[cfg_attr(feature = "ts", derive(TS))]
32744#[cfg_attr(feature = "ts", ts(export))]
32745pub struct TIME_ESTIMATE_TO_TARGET_DATA {
32746 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
32747 pub safe_return: i32,
32748 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
32749 pub land: i32,
32750 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
32751 pub mission_next_item: i32,
32752 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
32753 pub mission_end: i32,
32754 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
32755 pub commanded_action: i32,
32756}
32757impl TIME_ESTIMATE_TO_TARGET_DATA {
32758 pub const ENCODED_LEN: usize = 20usize;
32759 pub const DEFAULT: Self = Self {
32760 safe_return: 0_i32,
32761 land: 0_i32,
32762 mission_next_item: 0_i32,
32763 mission_end: 0_i32,
32764 commanded_action: 0_i32,
32765 };
32766 #[cfg(feature = "arbitrary")]
32767 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32768 use arbitrary::{Arbitrary, Unstructured};
32769 let mut buf = [0u8; 1024];
32770 rng.fill_bytes(&mut buf);
32771 let mut unstructured = Unstructured::new(&buf);
32772 Self::arbitrary(&mut unstructured).unwrap_or_default()
32773 }
32774}
32775impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
32776 fn default() -> Self {
32777 Self::DEFAULT.clone()
32778 }
32779}
32780impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
32781 type Message = MavMessage;
32782 const ID: u32 = 380u32;
32783 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
32784 const EXTRA_CRC: u8 = 232u8;
32785 const ENCODED_LEN: usize = 20usize;
32786 fn deser(
32787 _version: MavlinkVersion,
32788 __input: &[u8],
32789 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32790 let avail_len = __input.len();
32791 let mut payload_buf = [0; Self::ENCODED_LEN];
32792 let mut buf = if avail_len < Self::ENCODED_LEN {
32793 payload_buf[0..avail_len].copy_from_slice(__input);
32794 Bytes::new(&payload_buf)
32795 } else {
32796 Bytes::new(__input)
32797 };
32798 let mut __struct = Self::default();
32799 __struct.safe_return = buf.get_i32_le()?;
32800 __struct.land = buf.get_i32_le()?;
32801 __struct.mission_next_item = buf.get_i32_le()?;
32802 __struct.mission_end = buf.get_i32_le()?;
32803 __struct.commanded_action = buf.get_i32_le()?;
32804 Ok(__struct)
32805 }
32806 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32807 let mut __tmp = BytesMut::new(bytes);
32808 #[allow(clippy::absurd_extreme_comparisons)]
32809 #[allow(unused_comparisons)]
32810 if __tmp.remaining() < Self::ENCODED_LEN {
32811 panic!(
32812 "buffer is too small (need {} bytes, but got {})",
32813 Self::ENCODED_LEN,
32814 __tmp.remaining(),
32815 )
32816 }
32817 __tmp.put_i32_le(self.safe_return);
32818 __tmp.put_i32_le(self.land);
32819 __tmp.put_i32_le(self.mission_next_item);
32820 __tmp.put_i32_le(self.mission_end);
32821 __tmp.put_i32_le(self.commanded_action);
32822 if matches!(version, MavlinkVersion::V2) {
32823 let len = __tmp.len();
32824 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32825 } else {
32826 __tmp.len()
32827 }
32828 }
32829}
32830#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
32831#[doc = ""]
32832#[doc = "ID: 333"]
32833#[derive(Debug, Clone, PartialEq)]
32834#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32835#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32836#[cfg_attr(feature = "ts", derive(TS))]
32837#[cfg_attr(feature = "ts", ts(export))]
32838pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
32839 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32840 pub time_usec: u64,
32841 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
32842 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32843 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32844 pub pos_x: [f32; 5],
32845 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
32846 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32847 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32848 pub pos_y: [f32; 5],
32849 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
32850 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32851 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32852 pub pos_z: [f32; 5],
32853 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
32854 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32855 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32856 pub delta: [f32; 5],
32857 #[doc = "Yaw. Set to NaN for unchanged"]
32858 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32859 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32860 pub pos_yaw: [f32; 5],
32861 #[doc = "Number of valid control points (up-to 5 points are possible)"]
32862 pub valid_points: u8,
32863}
32864impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
32865 pub const ENCODED_LEN: usize = 109usize;
32866 pub const DEFAULT: Self = Self {
32867 time_usec: 0_u64,
32868 pos_x: [0.0_f32; 5usize],
32869 pos_y: [0.0_f32; 5usize],
32870 pos_z: [0.0_f32; 5usize],
32871 delta: [0.0_f32; 5usize],
32872 pos_yaw: [0.0_f32; 5usize],
32873 valid_points: 0_u8,
32874 };
32875 #[cfg(feature = "arbitrary")]
32876 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32877 use arbitrary::{Arbitrary, Unstructured};
32878 let mut buf = [0u8; 1024];
32879 rng.fill_bytes(&mut buf);
32880 let mut unstructured = Unstructured::new(&buf);
32881 Self::arbitrary(&mut unstructured).unwrap_or_default()
32882 }
32883}
32884impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
32885 fn default() -> Self {
32886 Self::DEFAULT.clone()
32887 }
32888}
32889impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
32890 type Message = MavMessage;
32891 const ID: u32 = 333u32;
32892 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
32893 const EXTRA_CRC: u8 = 231u8;
32894 const ENCODED_LEN: usize = 109usize;
32895 fn deser(
32896 _version: MavlinkVersion,
32897 __input: &[u8],
32898 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32899 let avail_len = __input.len();
32900 let mut payload_buf = [0; Self::ENCODED_LEN];
32901 let mut buf = if avail_len < Self::ENCODED_LEN {
32902 payload_buf[0..avail_len].copy_from_slice(__input);
32903 Bytes::new(&payload_buf)
32904 } else {
32905 Bytes::new(__input)
32906 };
32907 let mut __struct = Self::default();
32908 __struct.time_usec = buf.get_u64_le()?;
32909 for v in &mut __struct.pos_x {
32910 let val = buf.get_f32_le()?;
32911 *v = val;
32912 }
32913 for v in &mut __struct.pos_y {
32914 let val = buf.get_f32_le()?;
32915 *v = val;
32916 }
32917 for v in &mut __struct.pos_z {
32918 let val = buf.get_f32_le()?;
32919 *v = val;
32920 }
32921 for v in &mut __struct.delta {
32922 let val = buf.get_f32_le()?;
32923 *v = val;
32924 }
32925 for v in &mut __struct.pos_yaw {
32926 let val = buf.get_f32_le()?;
32927 *v = val;
32928 }
32929 __struct.valid_points = buf.get_u8()?;
32930 Ok(__struct)
32931 }
32932 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32933 let mut __tmp = BytesMut::new(bytes);
32934 #[allow(clippy::absurd_extreme_comparisons)]
32935 #[allow(unused_comparisons)]
32936 if __tmp.remaining() < Self::ENCODED_LEN {
32937 panic!(
32938 "buffer is too small (need {} bytes, but got {})",
32939 Self::ENCODED_LEN,
32940 __tmp.remaining(),
32941 )
32942 }
32943 __tmp.put_u64_le(self.time_usec);
32944 for val in &self.pos_x {
32945 __tmp.put_f32_le(*val);
32946 }
32947 for val in &self.pos_y {
32948 __tmp.put_f32_le(*val);
32949 }
32950 for val in &self.pos_z {
32951 __tmp.put_f32_le(*val);
32952 }
32953 for val in &self.delta {
32954 __tmp.put_f32_le(*val);
32955 }
32956 for val in &self.pos_yaw {
32957 __tmp.put_f32_le(*val);
32958 }
32959 __tmp.put_u8(self.valid_points);
32960 if matches!(version, MavlinkVersion::V2) {
32961 let len = __tmp.len();
32962 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32963 } else {
32964 __tmp.len()
32965 }
32966 }
32967}
32968#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
32969#[doc = ""]
32970#[doc = "ID: 332"]
32971#[derive(Debug, Clone, PartialEq)]
32972#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32973#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32974#[cfg_attr(feature = "ts", derive(TS))]
32975#[cfg_attr(feature = "ts", ts(export))]
32976pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
32977 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32978 pub time_usec: u64,
32979 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
32980 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32981 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32982 pub pos_x: [f32; 5],
32983 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
32984 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32985 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32986 pub pos_y: [f32; 5],
32987 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
32988 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32989 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32990 pub pos_z: [f32; 5],
32991 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
32992 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32993 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32994 pub vel_x: [f32; 5],
32995 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
32996 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32997 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32998 pub vel_y: [f32; 5],
32999 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
33000 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33001 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33002 pub vel_z: [f32; 5],
33003 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
33004 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33005 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33006 pub acc_x: [f32; 5],
33007 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
33008 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33009 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33010 pub acc_y: [f32; 5],
33011 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
33012 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33013 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33014 pub acc_z: [f32; 5],
33015 #[doc = "Yaw angle, set to NaN if not being used"]
33016 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33017 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33018 pub pos_yaw: [f32; 5],
33019 #[doc = "Yaw rate, set to NaN if not being used"]
33020 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33021 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33022 pub vel_yaw: [f32; 5],
33023 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
33024 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33025 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33026 pub command: [u16; 5],
33027 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
33028 pub valid_points: u8,
33029}
33030impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
33031 pub const ENCODED_LEN: usize = 239usize;
33032 pub const DEFAULT: Self = Self {
33033 time_usec: 0_u64,
33034 pos_x: [0.0_f32; 5usize],
33035 pos_y: [0.0_f32; 5usize],
33036 pos_z: [0.0_f32; 5usize],
33037 vel_x: [0.0_f32; 5usize],
33038 vel_y: [0.0_f32; 5usize],
33039 vel_z: [0.0_f32; 5usize],
33040 acc_x: [0.0_f32; 5usize],
33041 acc_y: [0.0_f32; 5usize],
33042 acc_z: [0.0_f32; 5usize],
33043 pos_yaw: [0.0_f32; 5usize],
33044 vel_yaw: [0.0_f32; 5usize],
33045 command: [0_u16; 5usize],
33046 valid_points: 0_u8,
33047 };
33048 #[cfg(feature = "arbitrary")]
33049 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33050 use arbitrary::{Arbitrary, Unstructured};
33051 let mut buf = [0u8; 1024];
33052 rng.fill_bytes(&mut buf);
33053 let mut unstructured = Unstructured::new(&buf);
33054 Self::arbitrary(&mut unstructured).unwrap_or_default()
33055 }
33056}
33057impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
33058 fn default() -> Self {
33059 Self::DEFAULT.clone()
33060 }
33061}
33062impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
33063 type Message = MavMessage;
33064 const ID: u32 = 332u32;
33065 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
33066 const EXTRA_CRC: u8 = 236u8;
33067 const ENCODED_LEN: usize = 239usize;
33068 fn deser(
33069 _version: MavlinkVersion,
33070 __input: &[u8],
33071 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33072 let avail_len = __input.len();
33073 let mut payload_buf = [0; Self::ENCODED_LEN];
33074 let mut buf = if avail_len < Self::ENCODED_LEN {
33075 payload_buf[0..avail_len].copy_from_slice(__input);
33076 Bytes::new(&payload_buf)
33077 } else {
33078 Bytes::new(__input)
33079 };
33080 let mut __struct = Self::default();
33081 __struct.time_usec = buf.get_u64_le()?;
33082 for v in &mut __struct.pos_x {
33083 let val = buf.get_f32_le()?;
33084 *v = val;
33085 }
33086 for v in &mut __struct.pos_y {
33087 let val = buf.get_f32_le()?;
33088 *v = val;
33089 }
33090 for v in &mut __struct.pos_z {
33091 let val = buf.get_f32_le()?;
33092 *v = val;
33093 }
33094 for v in &mut __struct.vel_x {
33095 let val = buf.get_f32_le()?;
33096 *v = val;
33097 }
33098 for v in &mut __struct.vel_y {
33099 let val = buf.get_f32_le()?;
33100 *v = val;
33101 }
33102 for v in &mut __struct.vel_z {
33103 let val = buf.get_f32_le()?;
33104 *v = val;
33105 }
33106 for v in &mut __struct.acc_x {
33107 let val = buf.get_f32_le()?;
33108 *v = val;
33109 }
33110 for v in &mut __struct.acc_y {
33111 let val = buf.get_f32_le()?;
33112 *v = val;
33113 }
33114 for v in &mut __struct.acc_z {
33115 let val = buf.get_f32_le()?;
33116 *v = val;
33117 }
33118 for v in &mut __struct.pos_yaw {
33119 let val = buf.get_f32_le()?;
33120 *v = val;
33121 }
33122 for v in &mut __struct.vel_yaw {
33123 let val = buf.get_f32_le()?;
33124 *v = val;
33125 }
33126 for v in &mut __struct.command {
33127 let val = buf.get_u16_le()?;
33128 *v = val;
33129 }
33130 __struct.valid_points = buf.get_u8()?;
33131 Ok(__struct)
33132 }
33133 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33134 let mut __tmp = BytesMut::new(bytes);
33135 #[allow(clippy::absurd_extreme_comparisons)]
33136 #[allow(unused_comparisons)]
33137 if __tmp.remaining() < Self::ENCODED_LEN {
33138 panic!(
33139 "buffer is too small (need {} bytes, but got {})",
33140 Self::ENCODED_LEN,
33141 __tmp.remaining(),
33142 )
33143 }
33144 __tmp.put_u64_le(self.time_usec);
33145 for val in &self.pos_x {
33146 __tmp.put_f32_le(*val);
33147 }
33148 for val in &self.pos_y {
33149 __tmp.put_f32_le(*val);
33150 }
33151 for val in &self.pos_z {
33152 __tmp.put_f32_le(*val);
33153 }
33154 for val in &self.vel_x {
33155 __tmp.put_f32_le(*val);
33156 }
33157 for val in &self.vel_y {
33158 __tmp.put_f32_le(*val);
33159 }
33160 for val in &self.vel_z {
33161 __tmp.put_f32_le(*val);
33162 }
33163 for val in &self.acc_x {
33164 __tmp.put_f32_le(*val);
33165 }
33166 for val in &self.acc_y {
33167 __tmp.put_f32_le(*val);
33168 }
33169 for val in &self.acc_z {
33170 __tmp.put_f32_le(*val);
33171 }
33172 for val in &self.pos_yaw {
33173 __tmp.put_f32_le(*val);
33174 }
33175 for val in &self.vel_yaw {
33176 __tmp.put_f32_le(*val);
33177 }
33178 for val in &self.command {
33179 __tmp.put_u16_le(*val);
33180 }
33181 __tmp.put_u8(self.valid_points);
33182 if matches!(version, MavlinkVersion::V2) {
33183 let len = __tmp.len();
33184 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33185 } else {
33186 __tmp.len()
33187 }
33188 }
33189}
33190#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
33191#[doc = ""]
33192#[doc = "ID: 385"]
33193#[derive(Debug, Clone, PartialEq)]
33194#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33195#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33196#[cfg_attr(feature = "ts", derive(TS))]
33197#[cfg_attr(feature = "ts", ts(export))]
33198pub struct TUNNEL_DATA {
33199 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
33200 pub payload_type: MavTunnelPayloadType,
33201 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
33202 pub target_system: u8,
33203 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
33204 pub target_component: u8,
33205 #[doc = "Length of the data transported in payload"]
33206 pub payload_length: u8,
33207 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
33208 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33209 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33210 pub payload: [u8; 128],
33211}
33212impl TUNNEL_DATA {
33213 pub const ENCODED_LEN: usize = 133usize;
33214 pub const DEFAULT: Self = Self {
33215 payload_type: MavTunnelPayloadType::DEFAULT,
33216 target_system: 0_u8,
33217 target_component: 0_u8,
33218 payload_length: 0_u8,
33219 payload: [0_u8; 128usize],
33220 };
33221 #[cfg(feature = "arbitrary")]
33222 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33223 use arbitrary::{Arbitrary, Unstructured};
33224 let mut buf = [0u8; 1024];
33225 rng.fill_bytes(&mut buf);
33226 let mut unstructured = Unstructured::new(&buf);
33227 Self::arbitrary(&mut unstructured).unwrap_or_default()
33228 }
33229}
33230impl Default for TUNNEL_DATA {
33231 fn default() -> Self {
33232 Self::DEFAULT.clone()
33233 }
33234}
33235impl MessageData for TUNNEL_DATA {
33236 type Message = MavMessage;
33237 const ID: u32 = 385u32;
33238 const NAME: &'static str = "TUNNEL";
33239 const EXTRA_CRC: u8 = 147u8;
33240 const ENCODED_LEN: usize = 133usize;
33241 fn deser(
33242 _version: MavlinkVersion,
33243 __input: &[u8],
33244 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33245 let avail_len = __input.len();
33246 let mut payload_buf = [0; Self::ENCODED_LEN];
33247 let mut buf = if avail_len < Self::ENCODED_LEN {
33248 payload_buf[0..avail_len].copy_from_slice(__input);
33249 Bytes::new(&payload_buf)
33250 } else {
33251 Bytes::new(__input)
33252 };
33253 let mut __struct = Self::default();
33254 let tmp = buf.get_u16_le()?;
33255 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
33256 ::mavlink_core::error::ParserError::InvalidEnum {
33257 enum_type: "MavTunnelPayloadType",
33258 value: tmp as u64,
33259 },
33260 )?;
33261 __struct.target_system = buf.get_u8()?;
33262 __struct.target_component = buf.get_u8()?;
33263 __struct.payload_length = buf.get_u8()?;
33264 for v in &mut __struct.payload {
33265 let val = buf.get_u8()?;
33266 *v = val;
33267 }
33268 Ok(__struct)
33269 }
33270 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33271 let mut __tmp = BytesMut::new(bytes);
33272 #[allow(clippy::absurd_extreme_comparisons)]
33273 #[allow(unused_comparisons)]
33274 if __tmp.remaining() < Self::ENCODED_LEN {
33275 panic!(
33276 "buffer is too small (need {} bytes, but got {})",
33277 Self::ENCODED_LEN,
33278 __tmp.remaining(),
33279 )
33280 }
33281 __tmp.put_u16_le(self.payload_type as u16);
33282 __tmp.put_u8(self.target_system);
33283 __tmp.put_u8(self.target_component);
33284 __tmp.put_u8(self.payload_length);
33285 for val in &self.payload {
33286 __tmp.put_u8(*val);
33287 }
33288 if matches!(version, MavlinkVersion::V2) {
33289 let len = __tmp.len();
33290 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33291 } else {
33292 __tmp.len()
33293 }
33294 }
33295}
33296#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
33297#[doc = ""]
33298#[doc = "ID: 311"]
33299#[derive(Debug, Clone, PartialEq)]
33300#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33301#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33302#[cfg_attr(feature = "ts", derive(TS))]
33303#[cfg_attr(feature = "ts", ts(export))]
33304pub struct UAVCAN_NODE_INFO_DATA {
33305 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
33306 pub time_usec: u64,
33307 #[doc = "Time since the start-up of the node."]
33308 pub uptime_sec: u32,
33309 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
33310 pub sw_vcs_commit: u32,
33311 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
33312 #[cfg_attr(feature = "ts", ts(type = "string"))]
33313 pub name: CharArray<80>,
33314 #[doc = "Hardware major version number."]
33315 pub hw_version_major: u8,
33316 #[doc = "Hardware minor version number."]
33317 pub hw_version_minor: u8,
33318 #[doc = "Hardware unique 128-bit ID."]
33319 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33320 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33321 pub hw_unique_id: [u8; 16],
33322 #[doc = "Software major version number."]
33323 pub sw_version_major: u8,
33324 #[doc = "Software minor version number."]
33325 pub sw_version_minor: u8,
33326}
33327impl UAVCAN_NODE_INFO_DATA {
33328 pub const ENCODED_LEN: usize = 116usize;
33329 pub const DEFAULT: Self = Self {
33330 time_usec: 0_u64,
33331 uptime_sec: 0_u32,
33332 sw_vcs_commit: 0_u32,
33333 name: CharArray::new([0_u8; 80usize]),
33334 hw_version_major: 0_u8,
33335 hw_version_minor: 0_u8,
33336 hw_unique_id: [0_u8; 16usize],
33337 sw_version_major: 0_u8,
33338 sw_version_minor: 0_u8,
33339 };
33340 #[cfg(feature = "arbitrary")]
33341 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33342 use arbitrary::{Arbitrary, Unstructured};
33343 let mut buf = [0u8; 1024];
33344 rng.fill_bytes(&mut buf);
33345 let mut unstructured = Unstructured::new(&buf);
33346 Self::arbitrary(&mut unstructured).unwrap_or_default()
33347 }
33348}
33349impl Default for UAVCAN_NODE_INFO_DATA {
33350 fn default() -> Self {
33351 Self::DEFAULT.clone()
33352 }
33353}
33354impl MessageData for UAVCAN_NODE_INFO_DATA {
33355 type Message = MavMessage;
33356 const ID: u32 = 311u32;
33357 const NAME: &'static str = "UAVCAN_NODE_INFO";
33358 const EXTRA_CRC: u8 = 95u8;
33359 const ENCODED_LEN: usize = 116usize;
33360 fn deser(
33361 _version: MavlinkVersion,
33362 __input: &[u8],
33363 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33364 let avail_len = __input.len();
33365 let mut payload_buf = [0; Self::ENCODED_LEN];
33366 let mut buf = if avail_len < Self::ENCODED_LEN {
33367 payload_buf[0..avail_len].copy_from_slice(__input);
33368 Bytes::new(&payload_buf)
33369 } else {
33370 Bytes::new(__input)
33371 };
33372 let mut __struct = Self::default();
33373 __struct.time_usec = buf.get_u64_le()?;
33374 __struct.uptime_sec = buf.get_u32_le()?;
33375 __struct.sw_vcs_commit = buf.get_u32_le()?;
33376 let mut tmp = [0_u8; 80usize];
33377 for v in &mut tmp {
33378 *v = buf.get_u8()?;
33379 }
33380 __struct.name = CharArray::new(tmp);
33381 __struct.hw_version_major = buf.get_u8()?;
33382 __struct.hw_version_minor = buf.get_u8()?;
33383 for v in &mut __struct.hw_unique_id {
33384 let val = buf.get_u8()?;
33385 *v = val;
33386 }
33387 __struct.sw_version_major = buf.get_u8()?;
33388 __struct.sw_version_minor = buf.get_u8()?;
33389 Ok(__struct)
33390 }
33391 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33392 let mut __tmp = BytesMut::new(bytes);
33393 #[allow(clippy::absurd_extreme_comparisons)]
33394 #[allow(unused_comparisons)]
33395 if __tmp.remaining() < Self::ENCODED_LEN {
33396 panic!(
33397 "buffer is too small (need {} bytes, but got {})",
33398 Self::ENCODED_LEN,
33399 __tmp.remaining(),
33400 )
33401 }
33402 __tmp.put_u64_le(self.time_usec);
33403 __tmp.put_u32_le(self.uptime_sec);
33404 __tmp.put_u32_le(self.sw_vcs_commit);
33405 for val in &self.name {
33406 __tmp.put_u8(*val);
33407 }
33408 __tmp.put_u8(self.hw_version_major);
33409 __tmp.put_u8(self.hw_version_minor);
33410 for val in &self.hw_unique_id {
33411 __tmp.put_u8(*val);
33412 }
33413 __tmp.put_u8(self.sw_version_major);
33414 __tmp.put_u8(self.sw_version_minor);
33415 if matches!(version, MavlinkVersion::V2) {
33416 let len = __tmp.len();
33417 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33418 } else {
33419 __tmp.len()
33420 }
33421 }
33422}
33423#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
33424#[doc = ""]
33425#[doc = "ID: 310"]
33426#[derive(Debug, Clone, PartialEq)]
33427#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33428#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33429#[cfg_attr(feature = "ts", derive(TS))]
33430#[cfg_attr(feature = "ts", ts(export))]
33431pub struct UAVCAN_NODE_STATUS_DATA {
33432 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
33433 pub time_usec: u64,
33434 #[doc = "Time since the start-up of the node."]
33435 pub uptime_sec: u32,
33436 #[doc = "Vendor-specific status information."]
33437 pub vendor_specific_status_code: u16,
33438 #[doc = "Generalized node health status."]
33439 pub health: UavcanNodeHealth,
33440 #[doc = "Generalized operating mode."]
33441 pub mode: UavcanNodeMode,
33442 #[doc = "Not used currently."]
33443 pub sub_mode: u8,
33444}
33445impl UAVCAN_NODE_STATUS_DATA {
33446 pub const ENCODED_LEN: usize = 17usize;
33447 pub const DEFAULT: Self = Self {
33448 time_usec: 0_u64,
33449 uptime_sec: 0_u32,
33450 vendor_specific_status_code: 0_u16,
33451 health: UavcanNodeHealth::DEFAULT,
33452 mode: UavcanNodeMode::DEFAULT,
33453 sub_mode: 0_u8,
33454 };
33455 #[cfg(feature = "arbitrary")]
33456 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33457 use arbitrary::{Arbitrary, Unstructured};
33458 let mut buf = [0u8; 1024];
33459 rng.fill_bytes(&mut buf);
33460 let mut unstructured = Unstructured::new(&buf);
33461 Self::arbitrary(&mut unstructured).unwrap_or_default()
33462 }
33463}
33464impl Default for UAVCAN_NODE_STATUS_DATA {
33465 fn default() -> Self {
33466 Self::DEFAULT.clone()
33467 }
33468}
33469impl MessageData for UAVCAN_NODE_STATUS_DATA {
33470 type Message = MavMessage;
33471 const ID: u32 = 310u32;
33472 const NAME: &'static str = "UAVCAN_NODE_STATUS";
33473 const EXTRA_CRC: u8 = 28u8;
33474 const ENCODED_LEN: usize = 17usize;
33475 fn deser(
33476 _version: MavlinkVersion,
33477 __input: &[u8],
33478 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33479 let avail_len = __input.len();
33480 let mut payload_buf = [0; Self::ENCODED_LEN];
33481 let mut buf = if avail_len < Self::ENCODED_LEN {
33482 payload_buf[0..avail_len].copy_from_slice(__input);
33483 Bytes::new(&payload_buf)
33484 } else {
33485 Bytes::new(__input)
33486 };
33487 let mut __struct = Self::default();
33488 __struct.time_usec = buf.get_u64_le()?;
33489 __struct.uptime_sec = buf.get_u32_le()?;
33490 __struct.vendor_specific_status_code = buf.get_u16_le()?;
33491 let tmp = buf.get_u8()?;
33492 __struct.health =
33493 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
33494 enum_type: "UavcanNodeHealth",
33495 value: tmp as u64,
33496 })?;
33497 let tmp = buf.get_u8()?;
33498 __struct.mode =
33499 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
33500 enum_type: "UavcanNodeMode",
33501 value: tmp as u64,
33502 })?;
33503 __struct.sub_mode = buf.get_u8()?;
33504 Ok(__struct)
33505 }
33506 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33507 let mut __tmp = BytesMut::new(bytes);
33508 #[allow(clippy::absurd_extreme_comparisons)]
33509 #[allow(unused_comparisons)]
33510 if __tmp.remaining() < Self::ENCODED_LEN {
33511 panic!(
33512 "buffer is too small (need {} bytes, but got {})",
33513 Self::ENCODED_LEN,
33514 __tmp.remaining(),
33515 )
33516 }
33517 __tmp.put_u64_le(self.time_usec);
33518 __tmp.put_u32_le(self.uptime_sec);
33519 __tmp.put_u16_le(self.vendor_specific_status_code);
33520 __tmp.put_u8(self.health as u8);
33521 __tmp.put_u8(self.mode as u8);
33522 __tmp.put_u8(self.sub_mode);
33523 if matches!(version, MavlinkVersion::V2) {
33524 let len = __tmp.len();
33525 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33526 } else {
33527 __tmp.len()
33528 }
33529 }
33530}
33531#[doc = "The global position resulting from GPS and sensor fusion."]
33532#[doc = ""]
33533#[doc = "ID: 340"]
33534#[derive(Debug, Clone, PartialEq)]
33535#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33536#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33537#[cfg_attr(feature = "ts", derive(TS))]
33538#[cfg_attr(feature = "ts", ts(export))]
33539pub struct UTM_GLOBAL_POSITION_DATA {
33540 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
33541 pub time: u64,
33542 #[doc = "Latitude (WGS84)"]
33543 pub lat: i32,
33544 #[doc = "Longitude (WGS84)"]
33545 pub lon: i32,
33546 #[doc = "Altitude (WGS84)"]
33547 pub alt: i32,
33548 #[doc = "Altitude above ground"]
33549 pub relative_alt: i32,
33550 #[doc = "Next waypoint, latitude (WGS84)"]
33551 pub next_lat: i32,
33552 #[doc = "Next waypoint, longitude (WGS84)"]
33553 pub next_lon: i32,
33554 #[doc = "Next waypoint, altitude (WGS84)"]
33555 pub next_alt: i32,
33556 #[doc = "Ground X speed (latitude, positive north)"]
33557 pub vx: i16,
33558 #[doc = "Ground Y speed (longitude, positive east)"]
33559 pub vy: i16,
33560 #[doc = "Ground Z speed (altitude, positive down)"]
33561 pub vz: i16,
33562 #[doc = "Horizontal position uncertainty (standard deviation)"]
33563 pub h_acc: u16,
33564 #[doc = "Altitude uncertainty (standard deviation)"]
33565 pub v_acc: u16,
33566 #[doc = "Speed uncertainty (standard deviation)"]
33567 pub vel_acc: u16,
33568 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
33569 pub update_rate: u16,
33570 #[doc = "Unique UAS ID."]
33571 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33572 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33573 pub uas_id: [u8; 18],
33574 #[doc = "Flight state"]
33575 pub flight_state: UtmFlightState,
33576 #[doc = "Bitwise OR combination of the data available flags."]
33577 pub flags: UtmDataAvailFlags,
33578}
33579impl UTM_GLOBAL_POSITION_DATA {
33580 pub const ENCODED_LEN: usize = 70usize;
33581 pub const DEFAULT: Self = Self {
33582 time: 0_u64,
33583 lat: 0_i32,
33584 lon: 0_i32,
33585 alt: 0_i32,
33586 relative_alt: 0_i32,
33587 next_lat: 0_i32,
33588 next_lon: 0_i32,
33589 next_alt: 0_i32,
33590 vx: 0_i16,
33591 vy: 0_i16,
33592 vz: 0_i16,
33593 h_acc: 0_u16,
33594 v_acc: 0_u16,
33595 vel_acc: 0_u16,
33596 update_rate: 0_u16,
33597 uas_id: [0_u8; 18usize],
33598 flight_state: UtmFlightState::DEFAULT,
33599 flags: UtmDataAvailFlags::DEFAULT,
33600 };
33601 #[cfg(feature = "arbitrary")]
33602 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33603 use arbitrary::{Arbitrary, Unstructured};
33604 let mut buf = [0u8; 1024];
33605 rng.fill_bytes(&mut buf);
33606 let mut unstructured = Unstructured::new(&buf);
33607 Self::arbitrary(&mut unstructured).unwrap_or_default()
33608 }
33609}
33610impl Default for UTM_GLOBAL_POSITION_DATA {
33611 fn default() -> Self {
33612 Self::DEFAULT.clone()
33613 }
33614}
33615impl MessageData for UTM_GLOBAL_POSITION_DATA {
33616 type Message = MavMessage;
33617 const ID: u32 = 340u32;
33618 const NAME: &'static str = "UTM_GLOBAL_POSITION";
33619 const EXTRA_CRC: u8 = 99u8;
33620 const ENCODED_LEN: usize = 70usize;
33621 fn deser(
33622 _version: MavlinkVersion,
33623 __input: &[u8],
33624 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33625 let avail_len = __input.len();
33626 let mut payload_buf = [0; Self::ENCODED_LEN];
33627 let mut buf = if avail_len < Self::ENCODED_LEN {
33628 payload_buf[0..avail_len].copy_from_slice(__input);
33629 Bytes::new(&payload_buf)
33630 } else {
33631 Bytes::new(__input)
33632 };
33633 let mut __struct = Self::default();
33634 __struct.time = buf.get_u64_le()?;
33635 __struct.lat = buf.get_i32_le()?;
33636 __struct.lon = buf.get_i32_le()?;
33637 __struct.alt = buf.get_i32_le()?;
33638 __struct.relative_alt = buf.get_i32_le()?;
33639 __struct.next_lat = buf.get_i32_le()?;
33640 __struct.next_lon = buf.get_i32_le()?;
33641 __struct.next_alt = buf.get_i32_le()?;
33642 __struct.vx = buf.get_i16_le()?;
33643 __struct.vy = buf.get_i16_le()?;
33644 __struct.vz = buf.get_i16_le()?;
33645 __struct.h_acc = buf.get_u16_le()?;
33646 __struct.v_acc = buf.get_u16_le()?;
33647 __struct.vel_acc = buf.get_u16_le()?;
33648 __struct.update_rate = buf.get_u16_le()?;
33649 for v in &mut __struct.uas_id {
33650 let val = buf.get_u8()?;
33651 *v = val;
33652 }
33653 let tmp = buf.get_u8()?;
33654 __struct.flight_state =
33655 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
33656 enum_type: "UtmFlightState",
33657 value: tmp as u64,
33658 })?;
33659 let tmp = buf.get_u8()?;
33660 __struct.flags = UtmDataAvailFlags::from_bits(tmp as <UtmDataAvailFlags as Flags>::Bits)
33661 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
33662 flag_type: "UtmDataAvailFlags",
33663 value: tmp as u64,
33664 })?;
33665 Ok(__struct)
33666 }
33667 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33668 let mut __tmp = BytesMut::new(bytes);
33669 #[allow(clippy::absurd_extreme_comparisons)]
33670 #[allow(unused_comparisons)]
33671 if __tmp.remaining() < Self::ENCODED_LEN {
33672 panic!(
33673 "buffer is too small (need {} bytes, but got {})",
33674 Self::ENCODED_LEN,
33675 __tmp.remaining(),
33676 )
33677 }
33678 __tmp.put_u64_le(self.time);
33679 __tmp.put_i32_le(self.lat);
33680 __tmp.put_i32_le(self.lon);
33681 __tmp.put_i32_le(self.alt);
33682 __tmp.put_i32_le(self.relative_alt);
33683 __tmp.put_i32_le(self.next_lat);
33684 __tmp.put_i32_le(self.next_lon);
33685 __tmp.put_i32_le(self.next_alt);
33686 __tmp.put_i16_le(self.vx);
33687 __tmp.put_i16_le(self.vy);
33688 __tmp.put_i16_le(self.vz);
33689 __tmp.put_u16_le(self.h_acc);
33690 __tmp.put_u16_le(self.v_acc);
33691 __tmp.put_u16_le(self.vel_acc);
33692 __tmp.put_u16_le(self.update_rate);
33693 for val in &self.uas_id {
33694 __tmp.put_u8(*val);
33695 }
33696 __tmp.put_u8(self.flight_state as u8);
33697 __tmp.put_u8(self.flags.bits() as u8);
33698 if matches!(version, MavlinkVersion::V2) {
33699 let len = __tmp.len();
33700 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33701 } else {
33702 __tmp.len()
33703 }
33704 }
33705}
33706#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
33707#[doc = ""]
33708#[doc = "ID: 248"]
33709#[derive(Debug, Clone, PartialEq)]
33710#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33711#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33712#[cfg_attr(feature = "ts", derive(TS))]
33713#[cfg_attr(feature = "ts", ts(export))]
33714pub struct V2_EXTENSION_DATA {
33715 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
33716 pub message_type: u16,
33717 #[doc = "Network ID (0 for broadcast)"]
33718 pub target_network: u8,
33719 #[doc = "System ID (0 for broadcast)"]
33720 pub target_system: u8,
33721 #[doc = "Component ID (0 for broadcast)"]
33722 pub target_component: u8,
33723 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
33724 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33725 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33726 pub payload: [u8; 249],
33727}
33728impl V2_EXTENSION_DATA {
33729 pub const ENCODED_LEN: usize = 254usize;
33730 pub const DEFAULT: Self = Self {
33731 message_type: 0_u16,
33732 target_network: 0_u8,
33733 target_system: 0_u8,
33734 target_component: 0_u8,
33735 payload: [0_u8; 249usize],
33736 };
33737 #[cfg(feature = "arbitrary")]
33738 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33739 use arbitrary::{Arbitrary, Unstructured};
33740 let mut buf = [0u8; 1024];
33741 rng.fill_bytes(&mut buf);
33742 let mut unstructured = Unstructured::new(&buf);
33743 Self::arbitrary(&mut unstructured).unwrap_or_default()
33744 }
33745}
33746impl Default for V2_EXTENSION_DATA {
33747 fn default() -> Self {
33748 Self::DEFAULT.clone()
33749 }
33750}
33751impl MessageData for V2_EXTENSION_DATA {
33752 type Message = MavMessage;
33753 const ID: u32 = 248u32;
33754 const NAME: &'static str = "V2_EXTENSION";
33755 const EXTRA_CRC: u8 = 8u8;
33756 const ENCODED_LEN: usize = 254usize;
33757 fn deser(
33758 _version: MavlinkVersion,
33759 __input: &[u8],
33760 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33761 let avail_len = __input.len();
33762 let mut payload_buf = [0; Self::ENCODED_LEN];
33763 let mut buf = if avail_len < Self::ENCODED_LEN {
33764 payload_buf[0..avail_len].copy_from_slice(__input);
33765 Bytes::new(&payload_buf)
33766 } else {
33767 Bytes::new(__input)
33768 };
33769 let mut __struct = Self::default();
33770 __struct.message_type = buf.get_u16_le()?;
33771 __struct.target_network = buf.get_u8()?;
33772 __struct.target_system = buf.get_u8()?;
33773 __struct.target_component = buf.get_u8()?;
33774 for v in &mut __struct.payload {
33775 let val = buf.get_u8()?;
33776 *v = val;
33777 }
33778 Ok(__struct)
33779 }
33780 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33781 let mut __tmp = BytesMut::new(bytes);
33782 #[allow(clippy::absurd_extreme_comparisons)]
33783 #[allow(unused_comparisons)]
33784 if __tmp.remaining() < Self::ENCODED_LEN {
33785 panic!(
33786 "buffer is too small (need {} bytes, but got {})",
33787 Self::ENCODED_LEN,
33788 __tmp.remaining(),
33789 )
33790 }
33791 __tmp.put_u16_le(self.message_type);
33792 __tmp.put_u8(self.target_network);
33793 __tmp.put_u8(self.target_system);
33794 __tmp.put_u8(self.target_component);
33795 for val in &self.payload {
33796 __tmp.put_u8(*val);
33797 }
33798 if matches!(version, MavlinkVersion::V2) {
33799 let len = __tmp.len();
33800 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33801 } else {
33802 __tmp.len()
33803 }
33804 }
33805}
33806#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
33807#[doc = ""]
33808#[doc = "ID: 74"]
33809#[derive(Debug, Clone, PartialEq)]
33810#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33811#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33812#[cfg_attr(feature = "ts", derive(TS))]
33813#[cfg_attr(feature = "ts", ts(export))]
33814pub struct VFR_HUD_DATA {
33815 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
33816 pub airspeed: f32,
33817 #[doc = "Current ground speed."]
33818 pub groundspeed: f32,
33819 #[doc = "Current altitude (MSL)."]
33820 pub alt: f32,
33821 #[doc = "Current climb rate."]
33822 pub climb: f32,
33823 #[doc = "Current heading in compass units (0-360, 0=north)."]
33824 pub heading: i16,
33825 #[doc = "Current throttle setting (0 to 100)."]
33826 pub throttle: u16,
33827}
33828impl VFR_HUD_DATA {
33829 pub const ENCODED_LEN: usize = 20usize;
33830 pub const DEFAULT: Self = Self {
33831 airspeed: 0.0_f32,
33832 groundspeed: 0.0_f32,
33833 alt: 0.0_f32,
33834 climb: 0.0_f32,
33835 heading: 0_i16,
33836 throttle: 0_u16,
33837 };
33838 #[cfg(feature = "arbitrary")]
33839 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33840 use arbitrary::{Arbitrary, Unstructured};
33841 let mut buf = [0u8; 1024];
33842 rng.fill_bytes(&mut buf);
33843 let mut unstructured = Unstructured::new(&buf);
33844 Self::arbitrary(&mut unstructured).unwrap_or_default()
33845 }
33846}
33847impl Default for VFR_HUD_DATA {
33848 fn default() -> Self {
33849 Self::DEFAULT.clone()
33850 }
33851}
33852impl MessageData for VFR_HUD_DATA {
33853 type Message = MavMessage;
33854 const ID: u32 = 74u32;
33855 const NAME: &'static str = "VFR_HUD";
33856 const EXTRA_CRC: u8 = 20u8;
33857 const ENCODED_LEN: usize = 20usize;
33858 fn deser(
33859 _version: MavlinkVersion,
33860 __input: &[u8],
33861 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33862 let avail_len = __input.len();
33863 let mut payload_buf = [0; Self::ENCODED_LEN];
33864 let mut buf = if avail_len < Self::ENCODED_LEN {
33865 payload_buf[0..avail_len].copy_from_slice(__input);
33866 Bytes::new(&payload_buf)
33867 } else {
33868 Bytes::new(__input)
33869 };
33870 let mut __struct = Self::default();
33871 __struct.airspeed = buf.get_f32_le()?;
33872 __struct.groundspeed = buf.get_f32_le()?;
33873 __struct.alt = buf.get_f32_le()?;
33874 __struct.climb = buf.get_f32_le()?;
33875 __struct.heading = buf.get_i16_le()?;
33876 __struct.throttle = buf.get_u16_le()?;
33877 Ok(__struct)
33878 }
33879 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33880 let mut __tmp = BytesMut::new(bytes);
33881 #[allow(clippy::absurd_extreme_comparisons)]
33882 #[allow(unused_comparisons)]
33883 if __tmp.remaining() < Self::ENCODED_LEN {
33884 panic!(
33885 "buffer is too small (need {} bytes, but got {})",
33886 Self::ENCODED_LEN,
33887 __tmp.remaining(),
33888 )
33889 }
33890 __tmp.put_f32_le(self.airspeed);
33891 __tmp.put_f32_le(self.groundspeed);
33892 __tmp.put_f32_le(self.alt);
33893 __tmp.put_f32_le(self.climb);
33894 __tmp.put_i16_le(self.heading);
33895 __tmp.put_u16_le(self.throttle);
33896 if matches!(version, MavlinkVersion::V2) {
33897 let len = __tmp.len();
33898 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33899 } else {
33900 __tmp.len()
33901 }
33902 }
33903}
33904#[doc = "Vibration levels and accelerometer clipping."]
33905#[doc = ""]
33906#[doc = "ID: 241"]
33907#[derive(Debug, Clone, PartialEq)]
33908#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33909#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33910#[cfg_attr(feature = "ts", derive(TS))]
33911#[cfg_attr(feature = "ts", ts(export))]
33912pub struct VIBRATION_DATA {
33913 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
33914 pub time_usec: u64,
33915 #[doc = "Vibration levels on X-axis"]
33916 pub vibration_x: f32,
33917 #[doc = "Vibration levels on Y-axis"]
33918 pub vibration_y: f32,
33919 #[doc = "Vibration levels on Z-axis"]
33920 pub vibration_z: f32,
33921 #[doc = "first accelerometer clipping count"]
33922 pub clipping_0: u32,
33923 #[doc = "second accelerometer clipping count"]
33924 pub clipping_1: u32,
33925 #[doc = "third accelerometer clipping count"]
33926 pub clipping_2: u32,
33927}
33928impl VIBRATION_DATA {
33929 pub const ENCODED_LEN: usize = 32usize;
33930 pub const DEFAULT: Self = Self {
33931 time_usec: 0_u64,
33932 vibration_x: 0.0_f32,
33933 vibration_y: 0.0_f32,
33934 vibration_z: 0.0_f32,
33935 clipping_0: 0_u32,
33936 clipping_1: 0_u32,
33937 clipping_2: 0_u32,
33938 };
33939 #[cfg(feature = "arbitrary")]
33940 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33941 use arbitrary::{Arbitrary, Unstructured};
33942 let mut buf = [0u8; 1024];
33943 rng.fill_bytes(&mut buf);
33944 let mut unstructured = Unstructured::new(&buf);
33945 Self::arbitrary(&mut unstructured).unwrap_or_default()
33946 }
33947}
33948impl Default for VIBRATION_DATA {
33949 fn default() -> Self {
33950 Self::DEFAULT.clone()
33951 }
33952}
33953impl MessageData for VIBRATION_DATA {
33954 type Message = MavMessage;
33955 const ID: u32 = 241u32;
33956 const NAME: &'static str = "VIBRATION";
33957 const EXTRA_CRC: u8 = 90u8;
33958 const ENCODED_LEN: usize = 32usize;
33959 fn deser(
33960 _version: MavlinkVersion,
33961 __input: &[u8],
33962 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33963 let avail_len = __input.len();
33964 let mut payload_buf = [0; Self::ENCODED_LEN];
33965 let mut buf = if avail_len < Self::ENCODED_LEN {
33966 payload_buf[0..avail_len].copy_from_slice(__input);
33967 Bytes::new(&payload_buf)
33968 } else {
33969 Bytes::new(__input)
33970 };
33971 let mut __struct = Self::default();
33972 __struct.time_usec = buf.get_u64_le()?;
33973 __struct.vibration_x = buf.get_f32_le()?;
33974 __struct.vibration_y = buf.get_f32_le()?;
33975 __struct.vibration_z = buf.get_f32_le()?;
33976 __struct.clipping_0 = buf.get_u32_le()?;
33977 __struct.clipping_1 = buf.get_u32_le()?;
33978 __struct.clipping_2 = buf.get_u32_le()?;
33979 Ok(__struct)
33980 }
33981 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33982 let mut __tmp = BytesMut::new(bytes);
33983 #[allow(clippy::absurd_extreme_comparisons)]
33984 #[allow(unused_comparisons)]
33985 if __tmp.remaining() < Self::ENCODED_LEN {
33986 panic!(
33987 "buffer is too small (need {} bytes, but got {})",
33988 Self::ENCODED_LEN,
33989 __tmp.remaining(),
33990 )
33991 }
33992 __tmp.put_u64_le(self.time_usec);
33993 __tmp.put_f32_le(self.vibration_x);
33994 __tmp.put_f32_le(self.vibration_y);
33995 __tmp.put_f32_le(self.vibration_z);
33996 __tmp.put_u32_le(self.clipping_0);
33997 __tmp.put_u32_le(self.clipping_1);
33998 __tmp.put_u32_le(self.clipping_2);
33999 if matches!(version, MavlinkVersion::V2) {
34000 let len = __tmp.len();
34001 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34002 } else {
34003 __tmp.len()
34004 }
34005 }
34006}
34007#[doc = "Global position estimate from a Vicon motion system source."]
34008#[doc = ""]
34009#[doc = "ID: 104"]
34010#[derive(Debug, Clone, PartialEq)]
34011#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34012#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34013#[cfg_attr(feature = "ts", derive(TS))]
34014#[cfg_attr(feature = "ts", ts(export))]
34015pub struct VICON_POSITION_ESTIMATE_DATA {
34016 #[doc = "Timestamp (UNIX time or time since system boot)"]
34017 pub usec: u64,
34018 #[doc = "Global X position"]
34019 pub x: f32,
34020 #[doc = "Global Y position"]
34021 pub y: f32,
34022 #[doc = "Global Z position"]
34023 pub z: f32,
34024 #[doc = "Roll angle"]
34025 pub roll: f32,
34026 #[doc = "Pitch angle"]
34027 pub pitch: f32,
34028 #[doc = "Yaw angle"]
34029 pub yaw: f32,
34030 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
34031 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
34032 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
34033 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
34034 pub covariance: [f32; 21],
34035}
34036impl VICON_POSITION_ESTIMATE_DATA {
34037 pub const ENCODED_LEN: usize = 116usize;
34038 pub const DEFAULT: Self = Self {
34039 usec: 0_u64,
34040 x: 0.0_f32,
34041 y: 0.0_f32,
34042 z: 0.0_f32,
34043 roll: 0.0_f32,
34044 pitch: 0.0_f32,
34045 yaw: 0.0_f32,
34046 covariance: [0.0_f32; 21usize],
34047 };
34048 #[cfg(feature = "arbitrary")]
34049 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34050 use arbitrary::{Arbitrary, Unstructured};
34051 let mut buf = [0u8; 1024];
34052 rng.fill_bytes(&mut buf);
34053 let mut unstructured = Unstructured::new(&buf);
34054 Self::arbitrary(&mut unstructured).unwrap_or_default()
34055 }
34056}
34057impl Default for VICON_POSITION_ESTIMATE_DATA {
34058 fn default() -> Self {
34059 Self::DEFAULT.clone()
34060 }
34061}
34062impl MessageData for VICON_POSITION_ESTIMATE_DATA {
34063 type Message = MavMessage;
34064 const ID: u32 = 104u32;
34065 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
34066 const EXTRA_CRC: u8 = 56u8;
34067 const ENCODED_LEN: usize = 116usize;
34068 fn deser(
34069 _version: MavlinkVersion,
34070 __input: &[u8],
34071 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34072 let avail_len = __input.len();
34073 let mut payload_buf = [0; Self::ENCODED_LEN];
34074 let mut buf = if avail_len < Self::ENCODED_LEN {
34075 payload_buf[0..avail_len].copy_from_slice(__input);
34076 Bytes::new(&payload_buf)
34077 } else {
34078 Bytes::new(__input)
34079 };
34080 let mut __struct = Self::default();
34081 __struct.usec = buf.get_u64_le()?;
34082 __struct.x = buf.get_f32_le()?;
34083 __struct.y = buf.get_f32_le()?;
34084 __struct.z = buf.get_f32_le()?;
34085 __struct.roll = buf.get_f32_le()?;
34086 __struct.pitch = buf.get_f32_le()?;
34087 __struct.yaw = buf.get_f32_le()?;
34088 for v in &mut __struct.covariance {
34089 let val = buf.get_f32_le()?;
34090 *v = val;
34091 }
34092 Ok(__struct)
34093 }
34094 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34095 let mut __tmp = BytesMut::new(bytes);
34096 #[allow(clippy::absurd_extreme_comparisons)]
34097 #[allow(unused_comparisons)]
34098 if __tmp.remaining() < Self::ENCODED_LEN {
34099 panic!(
34100 "buffer is too small (need {} bytes, but got {})",
34101 Self::ENCODED_LEN,
34102 __tmp.remaining(),
34103 )
34104 }
34105 __tmp.put_u64_le(self.usec);
34106 __tmp.put_f32_le(self.x);
34107 __tmp.put_f32_le(self.y);
34108 __tmp.put_f32_le(self.z);
34109 __tmp.put_f32_le(self.roll);
34110 __tmp.put_f32_le(self.pitch);
34111 __tmp.put_f32_le(self.yaw);
34112 if matches!(version, MavlinkVersion::V2) {
34113 for val in &self.covariance {
34114 __tmp.put_f32_le(*val);
34115 }
34116 let len = __tmp.len();
34117 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34118 } else {
34119 __tmp.len()
34120 }
34121 }
34122}
34123#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
34124#[doc = ""]
34125#[doc = "ID: 269"]
34126#[derive(Debug, Clone, PartialEq)]
34127#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34128#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34129#[cfg_attr(feature = "ts", derive(TS))]
34130#[cfg_attr(feature = "ts", ts(export))]
34131pub struct VIDEO_STREAM_INFORMATION_DATA {
34132 #[doc = "Frame rate."]
34133 pub framerate: f32,
34134 #[doc = "Bit rate."]
34135 pub bitrate: u32,
34136 #[doc = "Bitmap of stream status flags."]
34137 pub flags: VideoStreamStatusFlags,
34138 #[doc = "Horizontal resolution."]
34139 pub resolution_h: u16,
34140 #[doc = "Vertical resolution."]
34141 pub resolution_v: u16,
34142 #[doc = "Video image rotation clockwise."]
34143 pub rotation: u16,
34144 #[doc = "Horizontal Field of view."]
34145 pub hfov: u16,
34146 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
34147 pub stream_id: u8,
34148 #[doc = "Number of streams available."]
34149 pub count: u8,
34150 #[doc = "Type of stream."]
34151 pub mavtype: VideoStreamType,
34152 #[doc = "Stream name."]
34153 #[cfg_attr(feature = "ts", ts(type = "string"))]
34154 pub name: CharArray<32>,
34155 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
34156 #[cfg_attr(feature = "ts", ts(type = "string"))]
34157 pub uri: CharArray<160>,
34158 #[doc = "Encoding of stream."]
34159 #[cfg_attr(feature = "serde", serde(default))]
34160 pub encoding: VideoStreamEncoding,
34161 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
34162 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
34163 pub camera_device_id: u8,
34164}
34165impl VIDEO_STREAM_INFORMATION_DATA {
34166 pub const ENCODED_LEN: usize = 215usize;
34167 pub const DEFAULT: Self = Self {
34168 framerate: 0.0_f32,
34169 bitrate: 0_u32,
34170 flags: VideoStreamStatusFlags::DEFAULT,
34171 resolution_h: 0_u16,
34172 resolution_v: 0_u16,
34173 rotation: 0_u16,
34174 hfov: 0_u16,
34175 stream_id: 0_u8,
34176 count: 0_u8,
34177 mavtype: VideoStreamType::DEFAULT,
34178 name: CharArray::new([0_u8; 32usize]),
34179 uri: CharArray::new([0_u8; 160usize]),
34180 encoding: VideoStreamEncoding::DEFAULT,
34181 camera_device_id: 0_u8,
34182 };
34183 #[cfg(feature = "arbitrary")]
34184 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34185 use arbitrary::{Arbitrary, Unstructured};
34186 let mut buf = [0u8; 1024];
34187 rng.fill_bytes(&mut buf);
34188 let mut unstructured = Unstructured::new(&buf);
34189 Self::arbitrary(&mut unstructured).unwrap_or_default()
34190 }
34191}
34192impl Default for VIDEO_STREAM_INFORMATION_DATA {
34193 fn default() -> Self {
34194 Self::DEFAULT.clone()
34195 }
34196}
34197impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
34198 type Message = MavMessage;
34199 const ID: u32 = 269u32;
34200 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
34201 const EXTRA_CRC: u8 = 109u8;
34202 const ENCODED_LEN: usize = 215usize;
34203 fn deser(
34204 _version: MavlinkVersion,
34205 __input: &[u8],
34206 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34207 let avail_len = __input.len();
34208 let mut payload_buf = [0; Self::ENCODED_LEN];
34209 let mut buf = if avail_len < Self::ENCODED_LEN {
34210 payload_buf[0..avail_len].copy_from_slice(__input);
34211 Bytes::new(&payload_buf)
34212 } else {
34213 Bytes::new(__input)
34214 };
34215 let mut __struct = Self::default();
34216 __struct.framerate = buf.get_f32_le()?;
34217 __struct.bitrate = buf.get_u32_le()?;
34218 let tmp = buf.get_u16_le()?;
34219 __struct.flags =
34220 VideoStreamStatusFlags::from_bits(tmp as <VideoStreamStatusFlags as Flags>::Bits)
34221 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
34222 flag_type: "VideoStreamStatusFlags",
34223 value: tmp as u64,
34224 })?;
34225 __struct.resolution_h = buf.get_u16_le()?;
34226 __struct.resolution_v = buf.get_u16_le()?;
34227 __struct.rotation = buf.get_u16_le()?;
34228 __struct.hfov = buf.get_u16_le()?;
34229 __struct.stream_id = buf.get_u8()?;
34230 __struct.count = buf.get_u8()?;
34231 let tmp = buf.get_u8()?;
34232 __struct.mavtype =
34233 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
34234 enum_type: "VideoStreamType",
34235 value: tmp as u64,
34236 })?;
34237 let mut tmp = [0_u8; 32usize];
34238 for v in &mut tmp {
34239 *v = buf.get_u8()?;
34240 }
34241 __struct.name = CharArray::new(tmp);
34242 let mut tmp = [0_u8; 160usize];
34243 for v in &mut tmp {
34244 *v = buf.get_u8()?;
34245 }
34246 __struct.uri = CharArray::new(tmp);
34247 let tmp = buf.get_u8()?;
34248 __struct.encoding =
34249 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
34250 enum_type: "VideoStreamEncoding",
34251 value: tmp as u64,
34252 })?;
34253 __struct.camera_device_id = buf.get_u8()?;
34254 Ok(__struct)
34255 }
34256 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34257 let mut __tmp = BytesMut::new(bytes);
34258 #[allow(clippy::absurd_extreme_comparisons)]
34259 #[allow(unused_comparisons)]
34260 if __tmp.remaining() < Self::ENCODED_LEN {
34261 panic!(
34262 "buffer is too small (need {} bytes, but got {})",
34263 Self::ENCODED_LEN,
34264 __tmp.remaining(),
34265 )
34266 }
34267 __tmp.put_f32_le(self.framerate);
34268 __tmp.put_u32_le(self.bitrate);
34269 __tmp.put_u16_le(self.flags.bits() as u16);
34270 __tmp.put_u16_le(self.resolution_h);
34271 __tmp.put_u16_le(self.resolution_v);
34272 __tmp.put_u16_le(self.rotation);
34273 __tmp.put_u16_le(self.hfov);
34274 __tmp.put_u8(self.stream_id);
34275 __tmp.put_u8(self.count);
34276 __tmp.put_u8(self.mavtype as u8);
34277 for val in &self.name {
34278 __tmp.put_u8(*val);
34279 }
34280 for val in &self.uri {
34281 __tmp.put_u8(*val);
34282 }
34283 if matches!(version, MavlinkVersion::V2) {
34284 __tmp.put_u8(self.encoding as u8);
34285 __tmp.put_u8(self.camera_device_id);
34286 let len = __tmp.len();
34287 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34288 } else {
34289 __tmp.len()
34290 }
34291 }
34292}
34293#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
34294#[doc = ""]
34295#[doc = "ID: 270"]
34296#[derive(Debug, Clone, PartialEq)]
34297#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34298#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34299#[cfg_attr(feature = "ts", derive(TS))]
34300#[cfg_attr(feature = "ts", ts(export))]
34301pub struct VIDEO_STREAM_STATUS_DATA {
34302 #[doc = "Frame rate"]
34303 pub framerate: f32,
34304 #[doc = "Bit rate"]
34305 pub bitrate: u32,
34306 #[doc = "Bitmap of stream status flags"]
34307 pub flags: VideoStreamStatusFlags,
34308 #[doc = "Horizontal resolution"]
34309 pub resolution_h: u16,
34310 #[doc = "Vertical resolution"]
34311 pub resolution_v: u16,
34312 #[doc = "Video image rotation clockwise"]
34313 pub rotation: u16,
34314 #[doc = "Horizontal Field of view"]
34315 pub hfov: u16,
34316 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
34317 pub stream_id: u8,
34318 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
34319 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
34320 pub camera_device_id: u8,
34321}
34322impl VIDEO_STREAM_STATUS_DATA {
34323 pub const ENCODED_LEN: usize = 20usize;
34324 pub const DEFAULT: Self = Self {
34325 framerate: 0.0_f32,
34326 bitrate: 0_u32,
34327 flags: VideoStreamStatusFlags::DEFAULT,
34328 resolution_h: 0_u16,
34329 resolution_v: 0_u16,
34330 rotation: 0_u16,
34331 hfov: 0_u16,
34332 stream_id: 0_u8,
34333 camera_device_id: 0_u8,
34334 };
34335 #[cfg(feature = "arbitrary")]
34336 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34337 use arbitrary::{Arbitrary, Unstructured};
34338 let mut buf = [0u8; 1024];
34339 rng.fill_bytes(&mut buf);
34340 let mut unstructured = Unstructured::new(&buf);
34341 Self::arbitrary(&mut unstructured).unwrap_or_default()
34342 }
34343}
34344impl Default for VIDEO_STREAM_STATUS_DATA {
34345 fn default() -> Self {
34346 Self::DEFAULT.clone()
34347 }
34348}
34349impl MessageData for VIDEO_STREAM_STATUS_DATA {
34350 type Message = MavMessage;
34351 const ID: u32 = 270u32;
34352 const NAME: &'static str = "VIDEO_STREAM_STATUS";
34353 const EXTRA_CRC: u8 = 59u8;
34354 const ENCODED_LEN: usize = 20usize;
34355 fn deser(
34356 _version: MavlinkVersion,
34357 __input: &[u8],
34358 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34359 let avail_len = __input.len();
34360 let mut payload_buf = [0; Self::ENCODED_LEN];
34361 let mut buf = if avail_len < Self::ENCODED_LEN {
34362 payload_buf[0..avail_len].copy_from_slice(__input);
34363 Bytes::new(&payload_buf)
34364 } else {
34365 Bytes::new(__input)
34366 };
34367 let mut __struct = Self::default();
34368 __struct.framerate = buf.get_f32_le()?;
34369 __struct.bitrate = buf.get_u32_le()?;
34370 let tmp = buf.get_u16_le()?;
34371 __struct.flags =
34372 VideoStreamStatusFlags::from_bits(tmp as <VideoStreamStatusFlags as Flags>::Bits)
34373 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
34374 flag_type: "VideoStreamStatusFlags",
34375 value: tmp as u64,
34376 })?;
34377 __struct.resolution_h = buf.get_u16_le()?;
34378 __struct.resolution_v = buf.get_u16_le()?;
34379 __struct.rotation = buf.get_u16_le()?;
34380 __struct.hfov = buf.get_u16_le()?;
34381 __struct.stream_id = buf.get_u8()?;
34382 __struct.camera_device_id = buf.get_u8()?;
34383 Ok(__struct)
34384 }
34385 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34386 let mut __tmp = BytesMut::new(bytes);
34387 #[allow(clippy::absurd_extreme_comparisons)]
34388 #[allow(unused_comparisons)]
34389 if __tmp.remaining() < Self::ENCODED_LEN {
34390 panic!(
34391 "buffer is too small (need {} bytes, but got {})",
34392 Self::ENCODED_LEN,
34393 __tmp.remaining(),
34394 )
34395 }
34396 __tmp.put_f32_le(self.framerate);
34397 __tmp.put_u32_le(self.bitrate);
34398 __tmp.put_u16_le(self.flags.bits() as u16);
34399 __tmp.put_u16_le(self.resolution_h);
34400 __tmp.put_u16_le(self.resolution_v);
34401 __tmp.put_u16_le(self.rotation);
34402 __tmp.put_u16_le(self.hfov);
34403 __tmp.put_u8(self.stream_id);
34404 if matches!(version, MavlinkVersion::V2) {
34405 __tmp.put_u8(self.camera_device_id);
34406 let len = __tmp.len();
34407 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34408 } else {
34409 __tmp.len()
34410 }
34411 }
34412}
34413#[doc = "Local position/attitude estimate from a vision source."]
34414#[doc = ""]
34415#[doc = "ID: 102"]
34416#[derive(Debug, Clone, PartialEq)]
34417#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34418#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34419#[cfg_attr(feature = "ts", derive(TS))]
34420#[cfg_attr(feature = "ts", ts(export))]
34421pub struct VISION_POSITION_ESTIMATE_DATA {
34422 #[doc = "Timestamp (UNIX time or time since system boot)"]
34423 pub usec: u64,
34424 #[doc = "Local X position"]
34425 pub x: f32,
34426 #[doc = "Local Y position"]
34427 pub y: f32,
34428 #[doc = "Local Z position"]
34429 pub z: f32,
34430 #[doc = "Roll angle"]
34431 pub roll: f32,
34432 #[doc = "Pitch angle"]
34433 pub pitch: f32,
34434 #[doc = "Yaw angle"]
34435 pub yaw: f32,
34436 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
34437 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
34438 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
34439 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
34440 pub covariance: [f32; 21],
34441 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
34442 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
34443 pub reset_counter: u8,
34444}
34445impl VISION_POSITION_ESTIMATE_DATA {
34446 pub const ENCODED_LEN: usize = 117usize;
34447 pub const DEFAULT: Self = Self {
34448 usec: 0_u64,
34449 x: 0.0_f32,
34450 y: 0.0_f32,
34451 z: 0.0_f32,
34452 roll: 0.0_f32,
34453 pitch: 0.0_f32,
34454 yaw: 0.0_f32,
34455 covariance: [0.0_f32; 21usize],
34456 reset_counter: 0_u8,
34457 };
34458 #[cfg(feature = "arbitrary")]
34459 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34460 use arbitrary::{Arbitrary, Unstructured};
34461 let mut buf = [0u8; 1024];
34462 rng.fill_bytes(&mut buf);
34463 let mut unstructured = Unstructured::new(&buf);
34464 Self::arbitrary(&mut unstructured).unwrap_or_default()
34465 }
34466}
34467impl Default for VISION_POSITION_ESTIMATE_DATA {
34468 fn default() -> Self {
34469 Self::DEFAULT.clone()
34470 }
34471}
34472impl MessageData for VISION_POSITION_ESTIMATE_DATA {
34473 type Message = MavMessage;
34474 const ID: u32 = 102u32;
34475 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
34476 const EXTRA_CRC: u8 = 158u8;
34477 const ENCODED_LEN: usize = 117usize;
34478 fn deser(
34479 _version: MavlinkVersion,
34480 __input: &[u8],
34481 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34482 let avail_len = __input.len();
34483 let mut payload_buf = [0; Self::ENCODED_LEN];
34484 let mut buf = if avail_len < Self::ENCODED_LEN {
34485 payload_buf[0..avail_len].copy_from_slice(__input);
34486 Bytes::new(&payload_buf)
34487 } else {
34488 Bytes::new(__input)
34489 };
34490 let mut __struct = Self::default();
34491 __struct.usec = buf.get_u64_le()?;
34492 __struct.x = buf.get_f32_le()?;
34493 __struct.y = buf.get_f32_le()?;
34494 __struct.z = buf.get_f32_le()?;
34495 __struct.roll = buf.get_f32_le()?;
34496 __struct.pitch = buf.get_f32_le()?;
34497 __struct.yaw = buf.get_f32_le()?;
34498 for v in &mut __struct.covariance {
34499 let val = buf.get_f32_le()?;
34500 *v = val;
34501 }
34502 __struct.reset_counter = buf.get_u8()?;
34503 Ok(__struct)
34504 }
34505 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34506 let mut __tmp = BytesMut::new(bytes);
34507 #[allow(clippy::absurd_extreme_comparisons)]
34508 #[allow(unused_comparisons)]
34509 if __tmp.remaining() < Self::ENCODED_LEN {
34510 panic!(
34511 "buffer is too small (need {} bytes, but got {})",
34512 Self::ENCODED_LEN,
34513 __tmp.remaining(),
34514 )
34515 }
34516 __tmp.put_u64_le(self.usec);
34517 __tmp.put_f32_le(self.x);
34518 __tmp.put_f32_le(self.y);
34519 __tmp.put_f32_le(self.z);
34520 __tmp.put_f32_le(self.roll);
34521 __tmp.put_f32_le(self.pitch);
34522 __tmp.put_f32_le(self.yaw);
34523 if matches!(version, MavlinkVersion::V2) {
34524 for val in &self.covariance {
34525 __tmp.put_f32_le(*val);
34526 }
34527 __tmp.put_u8(self.reset_counter);
34528 let len = __tmp.len();
34529 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34530 } else {
34531 __tmp.len()
34532 }
34533 }
34534}
34535#[doc = "Speed estimate from a vision source."]
34536#[doc = ""]
34537#[doc = "ID: 103"]
34538#[derive(Debug, Clone, PartialEq)]
34539#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34540#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34541#[cfg_attr(feature = "ts", derive(TS))]
34542#[cfg_attr(feature = "ts", ts(export))]
34543pub struct VISION_SPEED_ESTIMATE_DATA {
34544 #[doc = "Timestamp (UNIX time or time since system boot)"]
34545 pub usec: u64,
34546 #[doc = "Global X speed"]
34547 pub x: f32,
34548 #[doc = "Global Y speed"]
34549 pub y: f32,
34550 #[doc = "Global Z speed"]
34551 pub z: f32,
34552 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
34553 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
34554 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
34555 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
34556 pub covariance: [f32; 9],
34557 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
34558 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
34559 pub reset_counter: u8,
34560}
34561impl VISION_SPEED_ESTIMATE_DATA {
34562 pub const ENCODED_LEN: usize = 57usize;
34563 pub const DEFAULT: Self = Self {
34564 usec: 0_u64,
34565 x: 0.0_f32,
34566 y: 0.0_f32,
34567 z: 0.0_f32,
34568 covariance: [0.0_f32; 9usize],
34569 reset_counter: 0_u8,
34570 };
34571 #[cfg(feature = "arbitrary")]
34572 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34573 use arbitrary::{Arbitrary, Unstructured};
34574 let mut buf = [0u8; 1024];
34575 rng.fill_bytes(&mut buf);
34576 let mut unstructured = Unstructured::new(&buf);
34577 Self::arbitrary(&mut unstructured).unwrap_or_default()
34578 }
34579}
34580impl Default for VISION_SPEED_ESTIMATE_DATA {
34581 fn default() -> Self {
34582 Self::DEFAULT.clone()
34583 }
34584}
34585impl MessageData for VISION_SPEED_ESTIMATE_DATA {
34586 type Message = MavMessage;
34587 const ID: u32 = 103u32;
34588 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
34589 const EXTRA_CRC: u8 = 208u8;
34590 const ENCODED_LEN: usize = 57usize;
34591 fn deser(
34592 _version: MavlinkVersion,
34593 __input: &[u8],
34594 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34595 let avail_len = __input.len();
34596 let mut payload_buf = [0; Self::ENCODED_LEN];
34597 let mut buf = if avail_len < Self::ENCODED_LEN {
34598 payload_buf[0..avail_len].copy_from_slice(__input);
34599 Bytes::new(&payload_buf)
34600 } else {
34601 Bytes::new(__input)
34602 };
34603 let mut __struct = Self::default();
34604 __struct.usec = buf.get_u64_le()?;
34605 __struct.x = buf.get_f32_le()?;
34606 __struct.y = buf.get_f32_le()?;
34607 __struct.z = buf.get_f32_le()?;
34608 for v in &mut __struct.covariance {
34609 let val = buf.get_f32_le()?;
34610 *v = val;
34611 }
34612 __struct.reset_counter = buf.get_u8()?;
34613 Ok(__struct)
34614 }
34615 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34616 let mut __tmp = BytesMut::new(bytes);
34617 #[allow(clippy::absurd_extreme_comparisons)]
34618 #[allow(unused_comparisons)]
34619 if __tmp.remaining() < Self::ENCODED_LEN {
34620 panic!(
34621 "buffer is too small (need {} bytes, but got {})",
34622 Self::ENCODED_LEN,
34623 __tmp.remaining(),
34624 )
34625 }
34626 __tmp.put_u64_le(self.usec);
34627 __tmp.put_f32_le(self.x);
34628 __tmp.put_f32_le(self.y);
34629 __tmp.put_f32_le(self.z);
34630 if matches!(version, MavlinkVersion::V2) {
34631 for val in &self.covariance {
34632 __tmp.put_f32_le(*val);
34633 }
34634 __tmp.put_u8(self.reset_counter);
34635 let len = __tmp.len();
34636 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34637 } else {
34638 __tmp.len()
34639 }
34640 }
34641}
34642#[doc = "Cumulative distance traveled for each reported wheel."]
34643#[doc = ""]
34644#[doc = "ID: 9000"]
34645#[derive(Debug, Clone, PartialEq)]
34646#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34647#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34648#[cfg_attr(feature = "ts", derive(TS))]
34649#[cfg_attr(feature = "ts", ts(export))]
34650pub struct WHEEL_DISTANCE_DATA {
34651 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
34652 pub time_usec: u64,
34653 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
34654 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
34655 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
34656 pub distance: [f64; 16],
34657 #[doc = "Number of wheels reported."]
34658 pub count: u8,
34659}
34660impl WHEEL_DISTANCE_DATA {
34661 pub const ENCODED_LEN: usize = 137usize;
34662 pub const DEFAULT: Self = Self {
34663 time_usec: 0_u64,
34664 distance: [0.0_f64; 16usize],
34665 count: 0_u8,
34666 };
34667 #[cfg(feature = "arbitrary")]
34668 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34669 use arbitrary::{Arbitrary, Unstructured};
34670 let mut buf = [0u8; 1024];
34671 rng.fill_bytes(&mut buf);
34672 let mut unstructured = Unstructured::new(&buf);
34673 Self::arbitrary(&mut unstructured).unwrap_or_default()
34674 }
34675}
34676impl Default for WHEEL_DISTANCE_DATA {
34677 fn default() -> Self {
34678 Self::DEFAULT.clone()
34679 }
34680}
34681impl MessageData for WHEEL_DISTANCE_DATA {
34682 type Message = MavMessage;
34683 const ID: u32 = 9000u32;
34684 const NAME: &'static str = "WHEEL_DISTANCE";
34685 const EXTRA_CRC: u8 = 113u8;
34686 const ENCODED_LEN: usize = 137usize;
34687 fn deser(
34688 _version: MavlinkVersion,
34689 __input: &[u8],
34690 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34691 let avail_len = __input.len();
34692 let mut payload_buf = [0; Self::ENCODED_LEN];
34693 let mut buf = if avail_len < Self::ENCODED_LEN {
34694 payload_buf[0..avail_len].copy_from_slice(__input);
34695 Bytes::new(&payload_buf)
34696 } else {
34697 Bytes::new(__input)
34698 };
34699 let mut __struct = Self::default();
34700 __struct.time_usec = buf.get_u64_le()?;
34701 for v in &mut __struct.distance {
34702 let val = buf.get_f64_le()?;
34703 *v = val;
34704 }
34705 __struct.count = buf.get_u8()?;
34706 Ok(__struct)
34707 }
34708 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34709 let mut __tmp = BytesMut::new(bytes);
34710 #[allow(clippy::absurd_extreme_comparisons)]
34711 #[allow(unused_comparisons)]
34712 if __tmp.remaining() < Self::ENCODED_LEN {
34713 panic!(
34714 "buffer is too small (need {} bytes, but got {})",
34715 Self::ENCODED_LEN,
34716 __tmp.remaining(),
34717 )
34718 }
34719 __tmp.put_u64_le(self.time_usec);
34720 for val in &self.distance {
34721 __tmp.put_f64_le(*val);
34722 }
34723 __tmp.put_u8(self.count);
34724 if matches!(version, MavlinkVersion::V2) {
34725 let len = __tmp.len();
34726 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34727 } else {
34728 __tmp.len()
34729 }
34730 }
34731}
34732#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
34733#[doc = ""]
34734#[doc = "ID: 299"]
34735#[derive(Debug, Clone, PartialEq)]
34736#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34737#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34738#[cfg_attr(feature = "ts", derive(TS))]
34739#[cfg_attr(feature = "ts", ts(export))]
34740pub struct WIFI_CONFIG_AP_DATA {
34741 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
34742 #[cfg_attr(feature = "ts", ts(type = "string"))]
34743 pub ssid: CharArray<32>,
34744 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
34745 #[cfg_attr(feature = "ts", ts(type = "string"))]
34746 pub password: CharArray<64>,
34747 #[doc = "WiFi Mode."]
34748 #[cfg_attr(feature = "serde", serde(default))]
34749 pub mode: WifiConfigApMode,
34750 #[doc = "Message acceptance response (sent back to GS)."]
34751 #[cfg_attr(feature = "serde", serde(default))]
34752 pub response: WifiConfigApResponse,
34753}
34754impl WIFI_CONFIG_AP_DATA {
34755 pub const ENCODED_LEN: usize = 98usize;
34756 pub const DEFAULT: Self = Self {
34757 ssid: CharArray::new([0_u8; 32usize]),
34758 password: CharArray::new([0_u8; 64usize]),
34759 mode: WifiConfigApMode::DEFAULT,
34760 response: WifiConfigApResponse::DEFAULT,
34761 };
34762 #[cfg(feature = "arbitrary")]
34763 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34764 use arbitrary::{Arbitrary, Unstructured};
34765 let mut buf = [0u8; 1024];
34766 rng.fill_bytes(&mut buf);
34767 let mut unstructured = Unstructured::new(&buf);
34768 Self::arbitrary(&mut unstructured).unwrap_or_default()
34769 }
34770}
34771impl Default for WIFI_CONFIG_AP_DATA {
34772 fn default() -> Self {
34773 Self::DEFAULT.clone()
34774 }
34775}
34776impl MessageData for WIFI_CONFIG_AP_DATA {
34777 type Message = MavMessage;
34778 const ID: u32 = 299u32;
34779 const NAME: &'static str = "WIFI_CONFIG_AP";
34780 const EXTRA_CRC: u8 = 19u8;
34781 const ENCODED_LEN: usize = 98usize;
34782 fn deser(
34783 _version: MavlinkVersion,
34784 __input: &[u8],
34785 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34786 let avail_len = __input.len();
34787 let mut payload_buf = [0; Self::ENCODED_LEN];
34788 let mut buf = if avail_len < Self::ENCODED_LEN {
34789 payload_buf[0..avail_len].copy_from_slice(__input);
34790 Bytes::new(&payload_buf)
34791 } else {
34792 Bytes::new(__input)
34793 };
34794 let mut __struct = Self::default();
34795 let mut tmp = [0_u8; 32usize];
34796 for v in &mut tmp {
34797 *v = buf.get_u8()?;
34798 }
34799 __struct.ssid = CharArray::new(tmp);
34800 let mut tmp = [0_u8; 64usize];
34801 for v in &mut tmp {
34802 *v = buf.get_u8()?;
34803 }
34804 __struct.password = CharArray::new(tmp);
34805 let tmp = buf.get_i8()?;
34806 __struct.mode =
34807 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
34808 enum_type: "WifiConfigApMode",
34809 value: tmp as u64,
34810 })?;
34811 let tmp = buf.get_i8()?;
34812 __struct.response =
34813 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
34814 enum_type: "WifiConfigApResponse",
34815 value: tmp as u64,
34816 })?;
34817 Ok(__struct)
34818 }
34819 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34820 let mut __tmp = BytesMut::new(bytes);
34821 #[allow(clippy::absurd_extreme_comparisons)]
34822 #[allow(unused_comparisons)]
34823 if __tmp.remaining() < Self::ENCODED_LEN {
34824 panic!(
34825 "buffer is too small (need {} bytes, but got {})",
34826 Self::ENCODED_LEN,
34827 __tmp.remaining(),
34828 )
34829 }
34830 for val in &self.ssid {
34831 __tmp.put_u8(*val);
34832 }
34833 for val in &self.password {
34834 __tmp.put_u8(*val);
34835 }
34836 if matches!(version, MavlinkVersion::V2) {
34837 __tmp.put_i8(self.mode as i8);
34838 __tmp.put_i8(self.response as i8);
34839 let len = __tmp.len();
34840 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34841 } else {
34842 __tmp.len()
34843 }
34844 }
34845}
34846#[doc = "Winch status."]
34847#[doc = ""]
34848#[doc = "ID: 9005"]
34849#[derive(Debug, Clone, PartialEq)]
34850#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34851#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34852#[cfg_attr(feature = "ts", derive(TS))]
34853#[cfg_attr(feature = "ts", ts(export))]
34854pub struct WINCH_STATUS_DATA {
34855 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
34856 pub time_usec: u64,
34857 #[doc = "Length of line released. NaN if unknown"]
34858 pub line_length: f32,
34859 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
34860 pub speed: f32,
34861 #[doc = "Tension on the line. NaN if unknown"]
34862 pub tension: f32,
34863 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
34864 pub voltage: f32,
34865 #[doc = "Current draw from the winch. NaN if unknown"]
34866 pub current: f32,
34867 #[doc = "Status flags"]
34868 pub status: MavWinchStatusFlag,
34869 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
34870 pub temperature: i16,
34871}
34872impl WINCH_STATUS_DATA {
34873 pub const ENCODED_LEN: usize = 34usize;
34874 pub const DEFAULT: Self = Self {
34875 time_usec: 0_u64,
34876 line_length: 0.0_f32,
34877 speed: 0.0_f32,
34878 tension: 0.0_f32,
34879 voltage: 0.0_f32,
34880 current: 0.0_f32,
34881 status: MavWinchStatusFlag::DEFAULT,
34882 temperature: 0_i16,
34883 };
34884 #[cfg(feature = "arbitrary")]
34885 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34886 use arbitrary::{Arbitrary, Unstructured};
34887 let mut buf = [0u8; 1024];
34888 rng.fill_bytes(&mut buf);
34889 let mut unstructured = Unstructured::new(&buf);
34890 Self::arbitrary(&mut unstructured).unwrap_or_default()
34891 }
34892}
34893impl Default for WINCH_STATUS_DATA {
34894 fn default() -> Self {
34895 Self::DEFAULT.clone()
34896 }
34897}
34898impl MessageData for WINCH_STATUS_DATA {
34899 type Message = MavMessage;
34900 const ID: u32 = 9005u32;
34901 const NAME: &'static str = "WINCH_STATUS";
34902 const EXTRA_CRC: u8 = 117u8;
34903 const ENCODED_LEN: usize = 34usize;
34904 fn deser(
34905 _version: MavlinkVersion,
34906 __input: &[u8],
34907 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34908 let avail_len = __input.len();
34909 let mut payload_buf = [0; Self::ENCODED_LEN];
34910 let mut buf = if avail_len < Self::ENCODED_LEN {
34911 payload_buf[0..avail_len].copy_from_slice(__input);
34912 Bytes::new(&payload_buf)
34913 } else {
34914 Bytes::new(__input)
34915 };
34916 let mut __struct = Self::default();
34917 __struct.time_usec = buf.get_u64_le()?;
34918 __struct.line_length = buf.get_f32_le()?;
34919 __struct.speed = buf.get_f32_le()?;
34920 __struct.tension = buf.get_f32_le()?;
34921 __struct.voltage = buf.get_f32_le()?;
34922 __struct.current = buf.get_f32_le()?;
34923 let tmp = buf.get_u32_le()?;
34924 __struct.status = MavWinchStatusFlag::from_bits(tmp as <MavWinchStatusFlag as Flags>::Bits)
34925 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
34926 flag_type: "MavWinchStatusFlag",
34927 value: tmp as u64,
34928 })?;
34929 __struct.temperature = buf.get_i16_le()?;
34930 Ok(__struct)
34931 }
34932 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34933 let mut __tmp = BytesMut::new(bytes);
34934 #[allow(clippy::absurd_extreme_comparisons)]
34935 #[allow(unused_comparisons)]
34936 if __tmp.remaining() < Self::ENCODED_LEN {
34937 panic!(
34938 "buffer is too small (need {} bytes, but got {})",
34939 Self::ENCODED_LEN,
34940 __tmp.remaining(),
34941 )
34942 }
34943 __tmp.put_u64_le(self.time_usec);
34944 __tmp.put_f32_le(self.line_length);
34945 __tmp.put_f32_le(self.speed);
34946 __tmp.put_f32_le(self.tension);
34947 __tmp.put_f32_le(self.voltage);
34948 __tmp.put_f32_le(self.current);
34949 __tmp.put_u32_le(self.status.bits() as u32);
34950 __tmp.put_i16_le(self.temperature);
34951 if matches!(version, MavlinkVersion::V2) {
34952 let len = __tmp.len();
34953 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34954 } else {
34955 __tmp.len()
34956 }
34957 }
34958}
34959#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
34960#[doc = ""]
34961#[doc = "ID: 231"]
34962#[derive(Debug, Clone, PartialEq)]
34963#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34964#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34965#[cfg_attr(feature = "ts", derive(TS))]
34966#[cfg_attr(feature = "ts", ts(export))]
34967pub struct WIND_COV_DATA {
34968 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
34969 pub time_usec: u64,
34970 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
34971 pub wind_x: f32,
34972 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
34973 pub wind_y: f32,
34974 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
34975 pub wind_z: f32,
34976 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
34977 pub var_horiz: f32,
34978 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
34979 pub var_vert: f32,
34980 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
34981 pub wind_alt: f32,
34982 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
34983 pub horiz_accuracy: f32,
34984 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
34985 pub vert_accuracy: f32,
34986}
34987impl WIND_COV_DATA {
34988 pub const ENCODED_LEN: usize = 40usize;
34989 pub const DEFAULT: Self = Self {
34990 time_usec: 0_u64,
34991 wind_x: 0.0_f32,
34992 wind_y: 0.0_f32,
34993 wind_z: 0.0_f32,
34994 var_horiz: 0.0_f32,
34995 var_vert: 0.0_f32,
34996 wind_alt: 0.0_f32,
34997 horiz_accuracy: 0.0_f32,
34998 vert_accuracy: 0.0_f32,
34999 };
35000 #[cfg(feature = "arbitrary")]
35001 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
35002 use arbitrary::{Arbitrary, Unstructured};
35003 let mut buf = [0u8; 1024];
35004 rng.fill_bytes(&mut buf);
35005 let mut unstructured = Unstructured::new(&buf);
35006 Self::arbitrary(&mut unstructured).unwrap_or_default()
35007 }
35008}
35009impl Default for WIND_COV_DATA {
35010 fn default() -> Self {
35011 Self::DEFAULT.clone()
35012 }
35013}
35014impl MessageData for WIND_COV_DATA {
35015 type Message = MavMessage;
35016 const ID: u32 = 231u32;
35017 const NAME: &'static str = "WIND_COV";
35018 const EXTRA_CRC: u8 = 105u8;
35019 const ENCODED_LEN: usize = 40usize;
35020 fn deser(
35021 _version: MavlinkVersion,
35022 __input: &[u8],
35023 ) -> Result<Self, ::mavlink_core::error::ParserError> {
35024 let avail_len = __input.len();
35025 let mut payload_buf = [0; Self::ENCODED_LEN];
35026 let mut buf = if avail_len < Self::ENCODED_LEN {
35027 payload_buf[0..avail_len].copy_from_slice(__input);
35028 Bytes::new(&payload_buf)
35029 } else {
35030 Bytes::new(__input)
35031 };
35032 let mut __struct = Self::default();
35033 __struct.time_usec = buf.get_u64_le()?;
35034 __struct.wind_x = buf.get_f32_le()?;
35035 __struct.wind_y = buf.get_f32_le()?;
35036 __struct.wind_z = buf.get_f32_le()?;
35037 __struct.var_horiz = buf.get_f32_le()?;
35038 __struct.var_vert = buf.get_f32_le()?;
35039 __struct.wind_alt = buf.get_f32_le()?;
35040 __struct.horiz_accuracy = buf.get_f32_le()?;
35041 __struct.vert_accuracy = buf.get_f32_le()?;
35042 Ok(__struct)
35043 }
35044 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
35045 let mut __tmp = BytesMut::new(bytes);
35046 #[allow(clippy::absurd_extreme_comparisons)]
35047 #[allow(unused_comparisons)]
35048 if __tmp.remaining() < Self::ENCODED_LEN {
35049 panic!(
35050 "buffer is too small (need {} bytes, but got {})",
35051 Self::ENCODED_LEN,
35052 __tmp.remaining(),
35053 )
35054 }
35055 __tmp.put_u64_le(self.time_usec);
35056 __tmp.put_f32_le(self.wind_x);
35057 __tmp.put_f32_le(self.wind_y);
35058 __tmp.put_f32_le(self.wind_z);
35059 __tmp.put_f32_le(self.var_horiz);
35060 __tmp.put_f32_le(self.var_vert);
35061 __tmp.put_f32_le(self.wind_alt);
35062 __tmp.put_f32_le(self.horiz_accuracy);
35063 __tmp.put_f32_le(self.vert_accuracy);
35064 if matches!(version, MavlinkVersion::V2) {
35065 let len = __tmp.len();
35066 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
35067 } else {
35068 __tmp.len()
35069 }
35070 }
35071}
35072#[derive(Clone, PartialEq, Debug)]
35073#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
35074#[cfg_attr(feature = "serde", serde(tag = "type"))]
35075#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
35076#[cfg_attr(feature = "ts", derive(TS))]
35077#[cfg_attr(feature = "ts", ts(export))]
35078#[repr(u32)]
35079pub enum MavMessage {
35080 #[doc = "Set the vehicle attitude and body angular rates."]
35081 #[doc = ""]
35082 #[doc = "ID: 140"]
35083 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
35084 #[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
35085 #[doc = ""]
35086 #[doc = "ID: 375"]
35087 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
35088 #[doc = "The location and information of an ADSB vehicle."]
35089 #[doc = ""]
35090 #[doc = "ID: 246"]
35091 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
35092 #[doc = "The airspeed measured by sensors and IMU."]
35093 #[doc = ""]
35094 #[doc = "ID: 182"]
35095 AIRSPEEDS(AIRSPEEDS_DATA),
35096 #[doc = "The location and information of an AIS vessel."]
35097 #[doc = ""]
35098 #[doc = "ID: 301"]
35099 AIS_VESSEL(AIS_VESSEL_DATA),
35100 #[doc = "The current system altitude."]
35101 #[doc = ""]
35102 #[doc = "ID: 141"]
35103 ALTITUDE(ALTITUDE_DATA),
35104 #[doc = "The altitude measured by sensors and IMU."]
35105 #[doc = ""]
35106 #[doc = "ID: 181"]
35107 ALTITUDES(ALTITUDES_DATA),
35108 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
35109 #[doc = ""]
35110 #[doc = "ID: 30"]
35111 ATTITUDE(ATTITUDE_DATA),
35112 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
35113 #[doc = ""]
35114 #[doc = "ID: 31"]
35115 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
35116 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
35117 #[doc = ""]
35118 #[doc = "ID: 61"]
35119 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
35120 #[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
35121 #[doc = ""]
35122 #[doc = "ID: 83"]
35123 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
35124 #[doc = "Motion capture attitude and position."]
35125 #[doc = ""]
35126 #[doc = "ID: 138"]
35127 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
35128 #[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
35129 #[doc = ""]
35130 #[doc = "ID: 7"]
35131 AUTH_KEY(AUTH_KEY_DATA),
35132 #[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
35133 #[doc = ""]
35134 #[doc = "ID: 286"]
35135 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
35136 #[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
35137 #[doc = ""]
35138 #[doc = "ID: 148"]
35139 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
35140 #[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
35141 #[doc = ""]
35142 #[doc = "ID: 435"]
35143 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
35144 #[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
35145 #[doc = ""]
35146 #[doc = "ID: 437"]
35147 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
35148 #[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
35149 #[doc = ""]
35150 #[doc = "ID: 372"]
35151 BATTERY_INFO(BATTERY_INFO_DATA),
35152 #[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
35153 #[doc = ""]
35154 #[doc = "ID: 147"]
35155 BATTERY_STATUS(BATTERY_STATUS_DATA),
35156 #[doc = "Report button state change."]
35157 #[doc = ""]
35158 #[doc = "ID: 257"]
35159 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
35160 #[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
35161 #[doc = ""]
35162 #[doc = "ID: 262"]
35163 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
35164 #[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
35165 #[doc = ""]
35166 #[doc = "ID: 271"]
35167 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
35168 #[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
35169 #[doc = ""]
35170 #[doc = "ID: 263"]
35171 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
35172 #[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
35173 #[doc = ""]
35174 #[doc = "ID: 259"]
35175 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
35176 #[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
35177 #[doc = ""]
35178 #[doc = "ID: 260"]
35179 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
35180 #[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
35181 #[doc = ""]
35182 #[doc = "ID: 277"]
35183 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
35184 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
35185 #[doc = ""]
35186 #[doc = "ID: 276"]
35187 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
35188 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
35189 #[doc = ""]
35190 #[doc = "ID: 275"]
35191 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
35192 #[doc = "Camera-IMU triggering and synchronisation message."]
35193 #[doc = ""]
35194 #[doc = "ID: 112"]
35195 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
35196 #[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
35197 #[doc = ""]
35198 #[doc = "ID: 387"]
35199 CANFD_FRAME(CANFD_FRAME_DATA),
35200 #[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
35201 #[doc = ""]
35202 #[doc = "ID: 388"]
35203 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
35204 #[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
35205 #[doc = ""]
35206 #[doc = "ID: 386"]
35207 CAN_FRAME(CAN_FRAME_DATA),
35208 #[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
35209 #[doc = ""]
35210 #[doc = "ID: 336"]
35211 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
35212 #[doc = "Report current used cellular network status."]
35213 #[doc = ""]
35214 #[doc = "ID: 334"]
35215 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
35216 #[doc = "Request to control this MAV."]
35217 #[doc = ""]
35218 #[doc = "ID: 5"]
35219 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
35220 #[doc = "Accept / deny control of this MAV."]
35221 #[doc = ""]
35222 #[doc = "ID: 6"]
35223 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
35224 #[doc = "Information about a potential collision."]
35225 #[doc = ""]
35226 #[doc = "ID: 247"]
35227 COLLISION(COLLISION_DATA),
35228 #[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
35229 #[doc = ""]
35230 #[doc = "ID: 77"]
35231 COMMAND_ACK(COMMAND_ACK_DATA),
35232 #[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
35233 #[doc = ""]
35234 #[doc = "ID: 80"]
35235 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
35236 #[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
35237 #[doc = ""]
35238 #[doc = "ID: 75"]
35239 COMMAND_INT(COMMAND_INT_DATA),
35240 #[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
35241 #[doc = ""]
35242 #[doc = "ID: 76"]
35243 COMMAND_LONG(COMMAND_LONG_DATA),
35244 #[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
35245 #[doc = ""]
35246 #[doc = "ID: 395"]
35247 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
35248 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
35249 #[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
35250 #[doc = ""]
35251 #[doc = "ID: 396"]
35252 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
35253 #[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
35254 #[doc = ""]
35255 #[doc = "ID: 397"]
35256 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
35257 #[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
35258 #[doc = ""]
35259 #[doc = "ID: 146"]
35260 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
35261 #[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
35262 #[doc = ""]
35263 #[doc = "ID: 411"]
35264 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
35265 #[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
35266 #[doc = ""]
35267 #[doc = "ID: 436"]
35268 CURRENT_MODE(CURRENT_MODE_DATA),
35269 #[doc = "Data stream status information."]
35270 #[doc = ""]
35271 #[doc = "ID: 67"]
35272 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
35273 DATA_STREAM(DATA_STREAM_DATA),
35274 #[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
35275 #[doc = ""]
35276 #[doc = "ID: 130"]
35277 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
35278 #[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
35279 #[doc = ""]
35280 #[doc = "ID: 254"]
35281 DEBUG(DEBUG_DATA),
35282 #[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
35283 #[doc = ""]
35284 #[doc = "ID: 350"]
35285 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
35286 #[doc = "To debug something using a named 3D vector."]
35287 #[doc = ""]
35288 #[doc = "ID: 250"]
35289 DEBUG_VECT(DEBUG_VECT_DATA),
35290 #[doc = "Distance sensor information for an onboard rangefinder."]
35291 #[doc = ""]
35292 #[doc = "ID: 132"]
35293 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
35294 #[doc = "EFI status output."]
35295 #[doc = ""]
35296 #[doc = "ID: 225"]
35297 EFI_STATUS(EFI_STATUS_DATA),
35298 #[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
35299 #[doc = ""]
35300 #[doc = "ID: 131"]
35301 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
35302 #[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
35303 #[doc = ""]
35304 #[doc = "ID: 290"]
35305 ESC_INFO(ESC_INFO_DATA),
35306 #[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
35307 #[doc = ""]
35308 #[doc = "ID: 291"]
35309 ESC_STATUS(ESC_STATUS_DATA),
35310 #[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
35311 #[doc = ""]
35312 #[doc = "ID: 230"]
35313 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
35314 #[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
35315 #[doc = ""]
35316 #[doc = "ID: 410"]
35317 EVENT(EVENT_DATA),
35318 #[doc = "Provides state for additional features."]
35319 #[doc = ""]
35320 #[doc = "ID: 245"]
35321 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
35322 #[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
35323 #[doc = ""]
35324 #[doc = "ID: 162"]
35325 FENCE_STATUS(FENCE_STATUS_DATA),
35326 #[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
35327 #[doc = ""]
35328 #[doc = "ID: 110"]
35329 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
35330 #[doc = "Flexifunction type and parameters for component at function index from buffer."]
35331 #[doc = ""]
35332 #[doc = "ID: 152"]
35333 FLEXIFUNCTION_BUFFER_FUNCTION(FLEXIFUNCTION_BUFFER_FUNCTION_DATA),
35334 #[doc = "Flexifunction type and parameters for component at function index from buffer."]
35335 #[doc = ""]
35336 #[doc = "ID: 153"]
35337 FLEXIFUNCTION_BUFFER_FUNCTION_ACK(FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA),
35338 #[doc = "Acknowldge success or failure of a flexifunction command."]
35339 #[doc = ""]
35340 #[doc = "ID: 157"]
35341 FLEXIFUNCTION_COMMAND(FLEXIFUNCTION_COMMAND_DATA),
35342 #[doc = "Acknowldge success or failure of a flexifunction command."]
35343 #[doc = ""]
35344 #[doc = "ID: 158"]
35345 FLEXIFUNCTION_COMMAND_ACK(FLEXIFUNCTION_COMMAND_ACK_DATA),
35346 #[doc = "Acknowldge success or failure of a flexifunction command."]
35347 #[doc = ""]
35348 #[doc = "ID: 155"]
35349 FLEXIFUNCTION_DIRECTORY(FLEXIFUNCTION_DIRECTORY_DATA),
35350 #[doc = "Acknowldge success or failure of a flexifunction command."]
35351 #[doc = ""]
35352 #[doc = "ID: 156"]
35353 FLEXIFUNCTION_DIRECTORY_ACK(FLEXIFUNCTION_DIRECTORY_ACK_DATA),
35354 #[doc = "Request reading of flexifunction data."]
35355 #[doc = ""]
35356 #[doc = "ID: 151"]
35357 FLEXIFUNCTION_READ_REQ(FLEXIFUNCTION_READ_REQ_DATA),
35358 #[doc = "Depreciated but used as a compiler flag. Do not remove."]
35359 #[doc = ""]
35360 #[doc = "ID: 150"]
35361 FLEXIFUNCTION_SET(FLEXIFUNCTION_SET_DATA),
35362 #[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
35363 #[doc = ""]
35364 #[doc = "ID: 264"]
35365 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
35366 #[doc = "Current motion information from a designated system."]
35367 #[doc = ""]
35368 #[doc = "ID: 144"]
35369 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
35370 #[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
35371 #[doc = ""]
35372 #[doc = "ID: 371"]
35373 FUEL_STATUS(FUEL_STATUS_DATA),
35374 #[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
35375 #[doc = ""]
35376 #[doc = "ID: 373"]
35377 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
35378 #[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
35379 #[doc = ""]
35380 #[doc = "ID: 285"]
35381 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
35382 #[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
35383 #[doc = ""]
35384 #[doc = "ID: 283"]
35385 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
35386 #[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
35387 #[doc = ""]
35388 #[doc = "ID: 284"]
35389 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
35390 #[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
35391 #[doc = ""]
35392 #[doc = "ID: 280"]
35393 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
35394 #[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
35395 #[doc = ""]
35396 #[doc = "ID: 282"]
35397 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
35398 #[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
35399 #[doc = ""]
35400 #[doc = "ID: 288"]
35401 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
35402 #[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
35403 #[doc = ""]
35404 #[doc = "ID: 287"]
35405 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
35406 #[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
35407 #[doc = ""]
35408 #[doc = "ID: 281"]
35409 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
35410 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
35411 #[doc = ""]
35412 #[doc = "ID: 33"]
35413 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
35414 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
35415 #[doc = ""]
35416 #[doc = "ID: 63"]
35417 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
35418 #[doc = "Global position/attitude estimate from a vision source."]
35419 #[doc = ""]
35420 #[doc = "ID: 101"]
35421 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
35422 #[doc = "Second GPS data."]
35423 #[doc = ""]
35424 #[doc = "ID: 124"]
35425 GPS2_RAW(GPS2_RAW_DATA),
35426 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
35427 #[doc = ""]
35428 #[doc = "ID: 128"]
35429 GPS2_RTK(GPS2_RTK_DATA),
35430 #[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
35431 #[doc = ""]
35432 #[doc = "ID: 49"]
35433 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
35434 #[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
35435 #[doc = ""]
35436 #[doc = "ID: 123"]
35437 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
35438 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
35439 #[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
35440 #[doc = ""]
35441 #[doc = "ID: 232"]
35442 GPS_INPUT(GPS_INPUT_DATA),
35443 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
35444 #[doc = ""]
35445 #[doc = "ID: 24"]
35446 GPS_RAW_INT(GPS_RAW_INT_DATA),
35447 #[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
35448 #[doc = ""]
35449 #[doc = "ID: 233"]
35450 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
35451 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
35452 #[doc = ""]
35453 #[doc = "ID: 127"]
35454 GPS_RTK(GPS_RTK_DATA),
35455 #[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
35456 #[doc = ""]
35457 #[doc = "ID: 25"]
35458 GPS_STATUS(GPS_STATUS_DATA),
35459 #[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
35460 #[doc = ""]
35461 #[doc = "ID: 0"]
35462 HEARTBEAT(HEARTBEAT_DATA),
35463 #[doc = "The IMU readings in SI units in NED body frame."]
35464 #[doc = ""]
35465 #[doc = "ID: 105"]
35466 HIGHRES_IMU(HIGHRES_IMU_DATA),
35467 #[doc = "Message appropriate for high latency connections like Iridium."]
35468 #[doc = ""]
35469 #[doc = "ID: 234"]
35470 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
35471 HIGH_LATENCY(HIGH_LATENCY_DATA),
35472 #[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
35473 #[doc = ""]
35474 #[doc = "ID: 235"]
35475 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
35476 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
35477 #[doc = ""]
35478 #[doc = "ID: 93"]
35479 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
35480 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
35481 #[doc = ""]
35482 #[doc = "ID: 91"]
35483 HIL_CONTROLS(HIL_CONTROLS_DATA),
35484 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
35485 #[doc = ""]
35486 #[doc = "ID: 113"]
35487 HIL_GPS(HIL_GPS_DATA),
35488 #[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
35489 #[doc = ""]
35490 #[doc = "ID: 114"]
35491 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
35492 #[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
35493 #[doc = ""]
35494 #[doc = "ID: 92"]
35495 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
35496 #[doc = "The IMU readings in SI units in NED body frame."]
35497 #[doc = ""]
35498 #[doc = "ID: 107"]
35499 HIL_SENSOR(HIL_SENSOR_DATA),
35500 #[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
35501 #[doc = ""]
35502 #[doc = "ID: 90"]
35503 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
35504 HIL_STATE(HIL_STATE_DATA),
35505 #[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
35506 #[doc = ""]
35507 #[doc = "ID: 115"]
35508 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
35509 #[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
35510 #[doc = ""]
35511 #[doc = "ID: 242"]
35512 HOME_POSITION(HOME_POSITION_DATA),
35513 #[doc = "Temperature and humidity from hygrometer."]
35514 #[doc = ""]
35515 #[doc = "ID: 12920"]
35516 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
35517 #[doc = "Illuminator status."]
35518 #[doc = ""]
35519 #[doc = "ID: 440"]
35520 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
35521 #[doc = "Status of the Iridium SBD link."]
35522 #[doc = ""]
35523 #[doc = "ID: 335"]
35524 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
35525 #[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
35526 #[doc = ""]
35527 #[doc = "ID: 149"]
35528 LANDING_TARGET(LANDING_TARGET_DATA),
35529 #[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
35530 #[doc = ""]
35531 #[doc = "ID: 8"]
35532 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
35533 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
35534 #[doc = ""]
35535 #[doc = "ID: 32"]
35536 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
35537 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
35538 #[doc = ""]
35539 #[doc = "ID: 64"]
35540 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
35541 #[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
35542 #[doc = ""]
35543 #[doc = "ID: 89"]
35544 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
35545 #[doc = "An ack for a LOGGING_DATA_ACKED message."]
35546 #[doc = ""]
35547 #[doc = "ID: 268"]
35548 LOGGING_ACK(LOGGING_ACK_DATA),
35549 #[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
35550 #[doc = ""]
35551 #[doc = "ID: 266"]
35552 LOGGING_DATA(LOGGING_DATA_DATA),
35553 #[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
35554 #[doc = ""]
35555 #[doc = "ID: 267"]
35556 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
35557 #[doc = "Reply to LOG_REQUEST_DATA."]
35558 #[doc = ""]
35559 #[doc = "ID: 120"]
35560 LOG_DATA(LOG_DATA_DATA),
35561 #[doc = "Reply to LOG_REQUEST_LIST."]
35562 #[doc = ""]
35563 #[doc = "ID: 118"]
35564 LOG_ENTRY(LOG_ENTRY_DATA),
35565 #[doc = "Erase all logs."]
35566 #[doc = ""]
35567 #[doc = "ID: 121"]
35568 LOG_ERASE(LOG_ERASE_DATA),
35569 #[doc = "Request a chunk of a log."]
35570 #[doc = ""]
35571 #[doc = "ID: 119"]
35572 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
35573 #[doc = "Stop log transfer and resume normal logging."]
35574 #[doc = ""]
35575 #[doc = "ID: 122"]
35576 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
35577 #[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
35578 #[doc = ""]
35579 #[doc = "ID: 117"]
35580 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
35581 #[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
35582 #[doc = ""]
35583 #[doc = "ID: 192"]
35584 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
35585 #[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
35586 #[doc = ""]
35587 #[doc = "ID: 69"]
35588 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
35589 #[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
35590 #[doc = ""]
35591 #[doc = "ID: 81"]
35592 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
35593 #[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
35594 #[doc = ""]
35595 #[doc = "ID: 249"]
35596 MEMORY_VECT(MEMORY_VECT_DATA),
35597 #[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
35598 #[doc = ""]
35599 #[doc = "ID: 244"]
35600 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
35601 #[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
35602 #[doc = ""]
35603 #[doc = "ID: 47"]
35604 MISSION_ACK(MISSION_ACK_DATA),
35605 #[doc = "Delete all mission items at once."]
35606 #[doc = ""]
35607 #[doc = "ID: 45"]
35608 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
35609 #[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
35610 #[doc = ""]
35611 #[doc = "ID: 44"]
35612 MISSION_COUNT(MISSION_COUNT_DATA),
35613 #[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
35614 #[doc = ""]
35615 #[doc = "ID: 42"]
35616 MISSION_CURRENT(MISSION_CURRENT_DATA),
35617 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
35618 #[doc = ""]
35619 #[doc = "ID: 39"]
35620 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
35621 MISSION_ITEM(MISSION_ITEM_DATA),
35622 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
35623 #[doc = ""]
35624 #[doc = "ID: 73"]
35625 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
35626 #[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
35627 #[doc = ""]
35628 #[doc = "ID: 46"]
35629 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
35630 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
35631 #[doc = ""]
35632 #[doc = "ID: 40"]
35633 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
35634 MISSION_REQUEST(MISSION_REQUEST_DATA),
35635 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
35636 #[doc = ""]
35637 #[doc = "ID: 51"]
35638 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
35639 #[doc = "Request the overall list of mission items from the system/component."]
35640 #[doc = ""]
35641 #[doc = "ID: 43"]
35642 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
35643 #[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
35644 #[doc = ""]
35645 #[doc = "ID: 37"]
35646 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
35647 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
35648 #[doc = ""]
35649 #[doc = "ID: 41"]
35650 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
35651 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
35652 #[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
35653 #[doc = ""]
35654 #[doc = "ID: 38"]
35655 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
35656 #[doc = "Orientation of a mount."]
35657 #[doc = ""]
35658 #[doc = "ID: 265"]
35659 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
35660 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
35661 #[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
35662 #[doc = ""]
35663 #[doc = "ID: 251"]
35664 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
35665 #[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
35666 #[doc = ""]
35667 #[doc = "ID: 252"]
35668 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
35669 #[doc = "The state of the navigation and position controller."]
35670 #[doc = ""]
35671 #[doc = "ID: 62"]
35672 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
35673 #[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
35674 #[doc = ""]
35675 #[doc = "ID: 330"]
35676 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
35677 #[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
35678 #[doc = ""]
35679 #[doc = "ID: 331"]
35680 ODOMETRY(ODOMETRY_DATA),
35681 #[doc = "Hardware status sent by an onboard computer."]
35682 #[doc = ""]
35683 #[doc = "ID: 390"]
35684 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
35685 #[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
35686 #[doc = ""]
35687 #[doc = "ID: 12918"]
35688 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
35689 #[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
35690 #[doc = ""]
35691 #[doc = "ID: 12902"]
35692 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
35693 #[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
35694 #[doc = ""]
35695 #[doc = "ID: 12900"]
35696 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
35697 #[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
35698 #[doc = ""]
35699 #[doc = "ID: 12901"]
35700 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
35701 #[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
35702 #[doc = ""]
35703 #[doc = "ID: 12915"]
35704 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
35705 #[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
35706 #[doc = ""]
35707 #[doc = "ID: 12905"]
35708 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
35709 #[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
35710 #[doc = ""]
35711 #[doc = "ID: 12903"]
35712 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
35713 #[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
35714 #[doc = ""]
35715 #[doc = "ID: 12904"]
35716 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
35717 #[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
35718 #[doc = ""]
35719 #[doc = "ID: 12919"]
35720 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
35721 #[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
35722 #[doc = ""]
35723 #[doc = "ID: 100"]
35724 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
35725 #[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
35726 #[doc = ""]
35727 #[doc = "ID: 106"]
35728 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
35729 #[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
35730 #[doc = ""]
35731 #[doc = "ID: 360"]
35732 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
35733 #[doc = "Response from a PARAM_EXT_SET message."]
35734 #[doc = ""]
35735 #[doc = "ID: 324"]
35736 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
35737 #[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
35738 #[doc = ""]
35739 #[doc = "ID: 321"]
35740 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
35741 #[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
35742 #[doc = ""]
35743 #[doc = "ID: 320"]
35744 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
35745 #[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
35746 #[doc = ""]
35747 #[doc = "ID: 323"]
35748 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
35749 #[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
35750 #[doc = ""]
35751 #[doc = "ID: 322"]
35752 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
35753 #[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
35754 #[doc = ""]
35755 #[doc = "ID: 50"]
35756 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
35757 #[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
35758 #[doc = ""]
35759 #[doc = "ID: 21"]
35760 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
35761 #[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
35762 #[doc = ""]
35763 #[doc = "ID: 20"]
35764 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
35765 #[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
35766 #[doc = ""]
35767 #[doc = "ID: 23"]
35768 PARAM_SET(PARAM_SET_DATA),
35769 #[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
35770 #[doc = ""]
35771 #[doc = "ID: 22"]
35772 PARAM_VALUE(PARAM_VALUE_DATA),
35773 #[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
35774 #[doc = ""]
35775 #[doc = "ID: 4"]
35776 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
35777 PING(PING_DATA),
35778 #[doc = "Control vehicle tone generation (buzzer)."]
35779 #[doc = ""]
35780 #[doc = "ID: 258"]
35781 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
35782 PLAY_TUNE(PLAY_TUNE_DATA),
35783 #[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
35784 #[doc = ""]
35785 #[doc = "ID: 400"]
35786 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
35787 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
35788 #[doc = ""]
35789 #[doc = "ID: 87"]
35790 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
35791 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
35792 #[doc = ""]
35793 #[doc = "ID: 85"]
35794 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
35795 #[doc = "Power supply status."]
35796 #[doc = ""]
35797 #[doc = "ID: 125"]
35798 POWER_STATUS(POWER_STATUS_DATA),
35799 #[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
35800 #[doc = ""]
35801 #[doc = "ID: 300"]
35802 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
35803 #[doc = "Status generated by radio and injected into MAVLink stream."]
35804 #[doc = ""]
35805 #[doc = "ID: 109"]
35806 RADIO_STATUS(RADIO_STATUS_DATA),
35807 #[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
35808 #[doc = ""]
35809 #[doc = "ID: 27"]
35810 RAW_IMU(RAW_IMU_DATA),
35811 #[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
35812 #[doc = ""]
35813 #[doc = "ID: 28"]
35814 RAW_PRESSURE(RAW_PRESSURE_DATA),
35815 #[doc = "RPM sensor data message."]
35816 #[doc = ""]
35817 #[doc = "ID: 339"]
35818 RAW_RPM(RAW_RPM_DATA),
35819 #[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
35820 #[doc = ""]
35821 #[doc = "ID: 65"]
35822 RC_CHANNELS(RC_CHANNELS_DATA),
35823 #[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
35824 #[doc = ""]
35825 #[doc = "ID: 70"]
35826 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
35827 #[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
35828 #[doc = ""]
35829 #[doc = "ID: 35"]
35830 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
35831 #[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
35832 #[doc = ""]
35833 #[doc = "ID: 34"]
35834 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
35835 #[doc = "Request a data stream."]
35836 #[doc = ""]
35837 #[doc = "ID: 66"]
35838 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
35839 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
35840 #[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
35841 #[doc = ""]
35842 #[doc = "ID: 412"]
35843 REQUEST_EVENT(REQUEST_EVENT_DATA),
35844 #[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
35845 #[doc = ""]
35846 #[doc = "ID: 142"]
35847 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
35848 #[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
35849 #[doc = ""]
35850 #[doc = "ID: 413"]
35851 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
35852 #[doc = "Read out the safety zone the MAV currently assumes."]
35853 #[doc = ""]
35854 #[doc = "ID: 55"]
35855 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
35856 #[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
35857 #[doc = ""]
35858 #[doc = "ID: 54"]
35859 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
35860 #[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
35861 #[doc = ""]
35862 #[doc = "ID: 26"]
35863 SCALED_IMU(SCALED_IMU_DATA),
35864 #[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
35865 #[doc = ""]
35866 #[doc = "ID: 116"]
35867 SCALED_IMU2(SCALED_IMU2_DATA),
35868 #[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
35869 #[doc = ""]
35870 #[doc = "ID: 129"]
35871 SCALED_IMU3(SCALED_IMU3_DATA),
35872 #[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
35873 #[doc = ""]
35874 #[doc = "ID: 29"]
35875 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
35876 #[doc = "Barometer readings for 2nd barometer."]
35877 #[doc = ""]
35878 #[doc = "ID: 137"]
35879 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
35880 #[doc = "Barometer readings for 3rd barometer."]
35881 #[doc = ""]
35882 #[doc = "ID: 143"]
35883 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
35884 #[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
35885 #[doc = ""]
35886 #[doc = "ID: 126"]
35887 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
35888 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F13: format."]
35889 #[doc = ""]
35890 #[doc = "ID: 177"]
35891 SERIAL_UDB_EXTRA_F13(SERIAL_UDB_EXTRA_F13_DATA),
35892 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F14: format."]
35893 #[doc = ""]
35894 #[doc = "ID: 178"]
35895 SERIAL_UDB_EXTRA_F14(SERIAL_UDB_EXTRA_F14_DATA),
35896 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F15 format."]
35897 #[doc = ""]
35898 #[doc = "ID: 179"]
35899 SERIAL_UDB_EXTRA_F15(SERIAL_UDB_EXTRA_F15_DATA),
35900 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F16 format."]
35901 #[doc = ""]
35902 #[doc = "ID: 180"]
35903 SERIAL_UDB_EXTRA_F16(SERIAL_UDB_EXTRA_F16_DATA),
35904 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F17 format."]
35905 #[doc = ""]
35906 #[doc = "ID: 183"]
35907 SERIAL_UDB_EXTRA_F17(SERIAL_UDB_EXTRA_F17_DATA),
35908 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F18 format."]
35909 #[doc = ""]
35910 #[doc = "ID: 184"]
35911 SERIAL_UDB_EXTRA_F18(SERIAL_UDB_EXTRA_F18_DATA),
35912 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F19 format."]
35913 #[doc = ""]
35914 #[doc = "ID: 185"]
35915 SERIAL_UDB_EXTRA_F19(SERIAL_UDB_EXTRA_F19_DATA),
35916 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F20 format."]
35917 #[doc = ""]
35918 #[doc = "ID: 186"]
35919 SERIAL_UDB_EXTRA_F20(SERIAL_UDB_EXTRA_F20_DATA),
35920 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F21 format."]
35921 #[doc = ""]
35922 #[doc = "ID: 187"]
35923 SERIAL_UDB_EXTRA_F21(SERIAL_UDB_EXTRA_F21_DATA),
35924 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F22 format."]
35925 #[doc = ""]
35926 #[doc = "ID: 188"]
35927 SERIAL_UDB_EXTRA_F22(SERIAL_UDB_EXTRA_F22_DATA),
35928 #[doc = "Backwards compatible MAVLink version of SERIAL_UDB_EXTRA - F2: Format Part A."]
35929 #[doc = ""]
35930 #[doc = "ID: 170"]
35931 SERIAL_UDB_EXTRA_F2_A(SERIAL_UDB_EXTRA_F2_A_DATA),
35932 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA - F2: Part B."]
35933 #[doc = ""]
35934 #[doc = "ID: 171"]
35935 SERIAL_UDB_EXTRA_F2_B(SERIAL_UDB_EXTRA_F2_B_DATA),
35936 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F4: format."]
35937 #[doc = ""]
35938 #[doc = "ID: 172"]
35939 SERIAL_UDB_EXTRA_F4(SERIAL_UDB_EXTRA_F4_DATA),
35940 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F5: format."]
35941 #[doc = ""]
35942 #[doc = "ID: 173"]
35943 SERIAL_UDB_EXTRA_F5(SERIAL_UDB_EXTRA_F5_DATA),
35944 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F6: format."]
35945 #[doc = ""]
35946 #[doc = "ID: 174"]
35947 SERIAL_UDB_EXTRA_F6(SERIAL_UDB_EXTRA_F6_DATA),
35948 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F7: format."]
35949 #[doc = ""]
35950 #[doc = "ID: 175"]
35951 SERIAL_UDB_EXTRA_F7(SERIAL_UDB_EXTRA_F7_DATA),
35952 #[doc = "Backwards compatible version of SERIAL_UDB_EXTRA F8: format."]
35953 #[doc = ""]
35954 #[doc = "ID: 176"]
35955 SERIAL_UDB_EXTRA_F8(SERIAL_UDB_EXTRA_F8_DATA),
35956 #[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
35957 #[doc = ""]
35958 #[doc = "ID: 36"]
35959 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
35960 #[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
35961 #[doc = ""]
35962 #[doc = "ID: 256"]
35963 SETUP_SIGNING(SETUP_SIGNING_DATA),
35964 #[doc = "Set the vehicle attitude and body angular rates."]
35965 #[doc = ""]
35966 #[doc = "ID: 139"]
35967 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
35968 #[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
35969 #[doc = ""]
35970 #[doc = "ID: 82"]
35971 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
35972 #[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
35973 #[doc = ""]
35974 #[doc = "ID: 48"]
35975 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
35976 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
35977 #[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
35978 #[doc = ""]
35979 #[doc = "ID: 243"]
35980 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
35981 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
35982 #[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
35983 #[doc = ""]
35984 #[doc = "ID: 11"]
35985 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
35986 SET_MODE(SET_MODE_DATA),
35987 #[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
35988 #[doc = ""]
35989 #[doc = "ID: 86"]
35990 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
35991 #[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
35992 #[doc = ""]
35993 #[doc = "ID: 84"]
35994 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
35995 #[doc = "Status of simulation environment, if used."]
35996 #[doc = ""]
35997 #[doc = "ID: 108"]
35998 SIM_STATE(SIM_STATE_DATA),
35999 #[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
36000 #[doc = ""]
36001 #[doc = "ID: 370"]
36002 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
36003 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
36004 #[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
36005 #[doc = ""]
36006 #[doc = "ID: 253"]
36007 STATUSTEXT(STATUSTEXT_DATA),
36008 #[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
36009 #[doc = ""]
36010 #[doc = "ID: 261"]
36011 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
36012 #[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
36013 #[doc = ""]
36014 #[doc = "ID: 401"]
36015 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
36016 #[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
36017 #[doc = ""]
36018 #[doc = "ID: 2"]
36019 SYSTEM_TIME(SYSTEM_TIME_DATA),
36020 #[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
36021 #[doc = ""]
36022 #[doc = "ID: 1"]
36023 SYS_STATUS(SYS_STATUS_DATA),
36024 #[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
36025 #[doc = ""]
36026 #[doc = "ID: 135"]
36027 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
36028 #[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
36029 #[doc = ""]
36030 #[doc = "ID: 134"]
36031 TERRAIN_DATA(TERRAIN_DATA_DATA),
36032 #[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
36033 #[doc = ""]
36034 #[doc = "ID: 136"]
36035 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
36036 #[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
36037 #[doc = ""]
36038 #[doc = "ID: 133"]
36039 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
36040 #[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
36041 #[doc = ""]
36042 #[doc = "ID: 111"]
36043 TIMESYNC(TIMESYNC_DATA),
36044 #[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
36045 #[doc = ""]
36046 #[doc = "ID: 380"]
36047 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
36048 #[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
36049 #[doc = ""]
36050 #[doc = "ID: 333"]
36051 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
36052 #[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
36053 #[doc = ""]
36054 #[doc = "ID: 332"]
36055 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
36056 #[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
36057 #[doc = ""]
36058 #[doc = "ID: 385"]
36059 TUNNEL(TUNNEL_DATA),
36060 #[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
36061 #[doc = ""]
36062 #[doc = "ID: 311"]
36063 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
36064 #[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
36065 #[doc = ""]
36066 #[doc = "ID: 310"]
36067 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
36068 #[doc = "The global position resulting from GPS and sensor fusion."]
36069 #[doc = ""]
36070 #[doc = "ID: 340"]
36071 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
36072 #[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
36073 #[doc = ""]
36074 #[doc = "ID: 248"]
36075 V2_EXTENSION(V2_EXTENSION_DATA),
36076 #[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
36077 #[doc = ""]
36078 #[doc = "ID: 74"]
36079 VFR_HUD(VFR_HUD_DATA),
36080 #[doc = "Vibration levels and accelerometer clipping."]
36081 #[doc = ""]
36082 #[doc = "ID: 241"]
36083 VIBRATION(VIBRATION_DATA),
36084 #[doc = "Global position estimate from a Vicon motion system source."]
36085 #[doc = ""]
36086 #[doc = "ID: 104"]
36087 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
36088 #[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
36089 #[doc = ""]
36090 #[doc = "ID: 269"]
36091 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
36092 #[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
36093 #[doc = ""]
36094 #[doc = "ID: 270"]
36095 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
36096 #[doc = "Local position/attitude estimate from a vision source."]
36097 #[doc = ""]
36098 #[doc = "ID: 102"]
36099 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
36100 #[doc = "Speed estimate from a vision source."]
36101 #[doc = ""]
36102 #[doc = "ID: 103"]
36103 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
36104 #[doc = "Cumulative distance traveled for each reported wheel."]
36105 #[doc = ""]
36106 #[doc = "ID: 9000"]
36107 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
36108 #[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
36109 #[doc = ""]
36110 #[doc = "ID: 299"]
36111 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
36112 #[doc = "Winch status."]
36113 #[doc = ""]
36114 #[doc = "ID: 9005"]
36115 WINCH_STATUS(WINCH_STATUS_DATA),
36116 #[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
36117 #[doc = ""]
36118 #[doc = "ID: 231"]
36119 WIND_COV(WIND_COV_DATA),
36120}
36121impl MavMessage {
36122 pub const fn all_ids() -> &'static [u32] {
36123 &[
36124 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
36125 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
36126 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
36127 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
36128 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
36129 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
36130 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
36131 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
36132 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
36133 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
36134 148u32, 149u32, 150u32, 151u32, 152u32, 153u32, 155u32, 156u32, 157u32, 158u32, 162u32,
36135 170u32, 171u32, 172u32, 173u32, 174u32, 175u32, 176u32, 177u32, 178u32, 179u32, 180u32,
36136 181u32, 182u32, 183u32, 184u32, 185u32, 186u32, 187u32, 188u32, 192u32, 225u32, 230u32,
36137 231u32, 232u32, 233u32, 234u32, 235u32, 241u32, 242u32, 243u32, 244u32, 245u32, 246u32,
36138 247u32, 248u32, 249u32, 250u32, 251u32, 252u32, 253u32, 254u32, 256u32, 257u32, 258u32,
36139 259u32, 260u32, 261u32, 262u32, 263u32, 264u32, 265u32, 266u32, 267u32, 268u32, 269u32,
36140 270u32, 271u32, 275u32, 276u32, 277u32, 280u32, 281u32, 282u32, 283u32, 284u32, 285u32,
36141 286u32, 287u32, 288u32, 290u32, 291u32, 299u32, 300u32, 301u32, 310u32, 311u32, 320u32,
36142 321u32, 322u32, 323u32, 324u32, 330u32, 331u32, 332u32, 333u32, 334u32, 335u32, 336u32,
36143 339u32, 340u32, 350u32, 360u32, 370u32, 371u32, 372u32, 373u32, 375u32, 380u32, 385u32,
36144 386u32, 387u32, 388u32, 390u32, 395u32, 396u32, 397u32, 400u32, 401u32, 410u32, 411u32,
36145 412u32, 413u32, 435u32, 436u32, 437u32, 440u32, 9000u32, 9005u32, 12900u32, 12901u32,
36146 12902u32, 12903u32, 12904u32, 12905u32, 12915u32, 12918u32, 12919u32, 12920u32,
36147 ]
36148 }
36149}
36150impl Message for MavMessage {
36151 fn parse(
36152 version: MavlinkVersion,
36153 id: u32,
36154 payload: &[u8],
36155 ) -> Result<Self, ::mavlink_core::error::ParserError> {
36156 match id {
36157 ACTUATOR_CONTROL_TARGET_DATA::ID => {
36158 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
36159 .map(Self::ACTUATOR_CONTROL_TARGET)
36160 }
36161 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
36162 .map(Self::ACTUATOR_OUTPUT_STATUS),
36163 ADSB_VEHICLE_DATA::ID => {
36164 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
36165 }
36166 AIRSPEEDS_DATA::ID => AIRSPEEDS_DATA::deser(version, payload).map(Self::AIRSPEEDS),
36167 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
36168 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
36169 ALTITUDES_DATA::ID => ALTITUDES_DATA::deser(version, payload).map(Self::ALTITUDES),
36170 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
36171 ATTITUDE_QUATERNION_DATA::ID => {
36172 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
36173 }
36174 ATTITUDE_QUATERNION_COV_DATA::ID => {
36175 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
36176 .map(Self::ATTITUDE_QUATERNION_COV)
36177 }
36178 ATTITUDE_TARGET_DATA::ID => {
36179 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
36180 }
36181 ATT_POS_MOCAP_DATA::ID => {
36182 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
36183 }
36184 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
36185 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
36186 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
36187 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
36188 }
36189 AUTOPILOT_VERSION_DATA::ID => {
36190 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
36191 }
36192 AVAILABLE_MODES_DATA::ID => {
36193 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
36194 }
36195 AVAILABLE_MODES_MONITOR_DATA::ID => {
36196 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
36197 .map(Self::AVAILABLE_MODES_MONITOR)
36198 }
36199 BATTERY_INFO_DATA::ID => {
36200 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
36201 }
36202 BATTERY_STATUS_DATA::ID => {
36203 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
36204 }
36205 BUTTON_CHANGE_DATA::ID => {
36206 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
36207 }
36208 CAMERA_CAPTURE_STATUS_DATA::ID => {
36209 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
36210 }
36211 CAMERA_FOV_STATUS_DATA::ID => {
36212 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
36213 }
36214 CAMERA_IMAGE_CAPTURED_DATA::ID => {
36215 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
36216 }
36217 CAMERA_INFORMATION_DATA::ID => {
36218 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
36219 }
36220 CAMERA_SETTINGS_DATA::ID => {
36221 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
36222 }
36223 CAMERA_THERMAL_RANGE_DATA::ID => {
36224 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
36225 }
36226 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
36227 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
36228 .map(Self::CAMERA_TRACKING_GEO_STATUS)
36229 }
36230 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
36231 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
36232 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
36233 }
36234 CAMERA_TRIGGER_DATA::ID => {
36235 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
36236 }
36237 CANFD_FRAME_DATA::ID => {
36238 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
36239 }
36240 CAN_FILTER_MODIFY_DATA::ID => {
36241 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
36242 }
36243 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
36244 CELLULAR_CONFIG_DATA::ID => {
36245 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
36246 }
36247 CELLULAR_STATUS_DATA::ID => {
36248 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
36249 }
36250 CHANGE_OPERATOR_CONTROL_DATA::ID => {
36251 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
36252 .map(Self::CHANGE_OPERATOR_CONTROL)
36253 }
36254 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
36255 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
36256 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
36257 }
36258 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
36259 COMMAND_ACK_DATA::ID => {
36260 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
36261 }
36262 COMMAND_CANCEL_DATA::ID => {
36263 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
36264 }
36265 COMMAND_INT_DATA::ID => {
36266 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
36267 }
36268 COMMAND_LONG_DATA::ID => {
36269 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
36270 }
36271 COMPONENT_INFORMATION_DATA::ID => {
36272 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
36273 }
36274 COMPONENT_INFORMATION_BASIC_DATA::ID => {
36275 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
36276 .map(Self::COMPONENT_INFORMATION_BASIC)
36277 }
36278 COMPONENT_METADATA_DATA::ID => {
36279 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
36280 }
36281 CONTROL_SYSTEM_STATE_DATA::ID => {
36282 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
36283 }
36284 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
36285 .map(Self::CURRENT_EVENT_SEQUENCE),
36286 CURRENT_MODE_DATA::ID => {
36287 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
36288 }
36289 DATA_STREAM_DATA::ID => {
36290 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
36291 }
36292 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
36293 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
36294 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
36295 }
36296 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
36297 DEBUG_FLOAT_ARRAY_DATA::ID => {
36298 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
36299 }
36300 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
36301 DISTANCE_SENSOR_DATA::ID => {
36302 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
36303 }
36304 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
36305 ENCAPSULATED_DATA_DATA::ID => {
36306 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
36307 }
36308 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
36309 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
36310 ESTIMATOR_STATUS_DATA::ID => {
36311 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
36312 }
36313 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
36314 EXTENDED_SYS_STATE_DATA::ID => {
36315 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
36316 }
36317 FENCE_STATUS_DATA::ID => {
36318 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
36319 }
36320 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
36321 .map(Self::FILE_TRANSFER_PROTOCOL),
36322 FLEXIFUNCTION_BUFFER_FUNCTION_DATA::ID => {
36323 FLEXIFUNCTION_BUFFER_FUNCTION_DATA::deser(version, payload)
36324 .map(Self::FLEXIFUNCTION_BUFFER_FUNCTION)
36325 }
36326 FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA::ID => {
36327 FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA::deser(version, payload)
36328 .map(Self::FLEXIFUNCTION_BUFFER_FUNCTION_ACK)
36329 }
36330 FLEXIFUNCTION_COMMAND_DATA::ID => {
36331 FLEXIFUNCTION_COMMAND_DATA::deser(version, payload).map(Self::FLEXIFUNCTION_COMMAND)
36332 }
36333 FLEXIFUNCTION_COMMAND_ACK_DATA::ID => {
36334 FLEXIFUNCTION_COMMAND_ACK_DATA::deser(version, payload)
36335 .map(Self::FLEXIFUNCTION_COMMAND_ACK)
36336 }
36337 FLEXIFUNCTION_DIRECTORY_DATA::ID => {
36338 FLEXIFUNCTION_DIRECTORY_DATA::deser(version, payload)
36339 .map(Self::FLEXIFUNCTION_DIRECTORY)
36340 }
36341 FLEXIFUNCTION_DIRECTORY_ACK_DATA::ID => {
36342 FLEXIFUNCTION_DIRECTORY_ACK_DATA::deser(version, payload)
36343 .map(Self::FLEXIFUNCTION_DIRECTORY_ACK)
36344 }
36345 FLEXIFUNCTION_READ_REQ_DATA::ID => FLEXIFUNCTION_READ_REQ_DATA::deser(version, payload)
36346 .map(Self::FLEXIFUNCTION_READ_REQ),
36347 FLEXIFUNCTION_SET_DATA::ID => {
36348 FLEXIFUNCTION_SET_DATA::deser(version, payload).map(Self::FLEXIFUNCTION_SET)
36349 }
36350 FLIGHT_INFORMATION_DATA::ID => {
36351 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
36352 }
36353 FOLLOW_TARGET_DATA::ID => {
36354 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
36355 }
36356 FUEL_STATUS_DATA::ID => {
36357 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
36358 }
36359 GENERATOR_STATUS_DATA::ID => {
36360 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
36361 }
36362 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
36363 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
36364 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
36365 }
36366 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
36367 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
36368 .map(Self::GIMBAL_DEVICE_INFORMATION)
36369 }
36370 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
36371 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
36372 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
36373 }
36374 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
36375 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
36376 .map(Self::GIMBAL_MANAGER_INFORMATION)
36377 }
36378 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
36379 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
36380 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
36381 }
36382 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
36383 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
36384 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
36385 }
36386 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
36387 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
36388 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
36389 }
36390 GIMBAL_MANAGER_STATUS_DATA::ID => {
36391 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
36392 }
36393 GLOBAL_POSITION_INT_DATA::ID => {
36394 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
36395 }
36396 GLOBAL_POSITION_INT_COV_DATA::ID => {
36397 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
36398 .map(Self::GLOBAL_POSITION_INT_COV)
36399 }
36400 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
36401 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
36402 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
36403 }
36404 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
36405 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
36406 GPS_GLOBAL_ORIGIN_DATA::ID => {
36407 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
36408 }
36409 GPS_INJECT_DATA_DATA::ID => {
36410 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
36411 }
36412 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
36413 GPS_RAW_INT_DATA::ID => {
36414 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
36415 }
36416 GPS_RTCM_DATA_DATA::ID => {
36417 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
36418 }
36419 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
36420 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
36421 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
36422 HIGHRES_IMU_DATA::ID => {
36423 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
36424 }
36425 HIGH_LATENCY_DATA::ID => {
36426 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
36427 }
36428 HIGH_LATENCY2_DATA::ID => {
36429 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
36430 }
36431 HIL_ACTUATOR_CONTROLS_DATA::ID => {
36432 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
36433 }
36434 HIL_CONTROLS_DATA::ID => {
36435 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
36436 }
36437 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
36438 HIL_OPTICAL_FLOW_DATA::ID => {
36439 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
36440 }
36441 HIL_RC_INPUTS_RAW_DATA::ID => {
36442 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
36443 }
36444 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
36445 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
36446 HIL_STATE_QUATERNION_DATA::ID => {
36447 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
36448 }
36449 HOME_POSITION_DATA::ID => {
36450 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
36451 }
36452 HYGROMETER_SENSOR_DATA::ID => {
36453 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
36454 }
36455 ILLUMINATOR_STATUS_DATA::ID => {
36456 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
36457 }
36458 ISBD_LINK_STATUS_DATA::ID => {
36459 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
36460 }
36461 LANDING_TARGET_DATA::ID => {
36462 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
36463 }
36464 LINK_NODE_STATUS_DATA::ID => {
36465 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
36466 }
36467 LOCAL_POSITION_NED_DATA::ID => {
36468 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
36469 }
36470 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
36471 .map(Self::LOCAL_POSITION_NED_COV),
36472 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
36473 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
36474 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
36475 }
36476 LOGGING_ACK_DATA::ID => {
36477 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
36478 }
36479 LOGGING_DATA_DATA::ID => {
36480 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
36481 }
36482 LOGGING_DATA_ACKED_DATA::ID => {
36483 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
36484 }
36485 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
36486 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
36487 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
36488 LOG_REQUEST_DATA_DATA::ID => {
36489 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
36490 }
36491 LOG_REQUEST_END_DATA::ID => {
36492 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
36493 }
36494 LOG_REQUEST_LIST_DATA::ID => {
36495 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
36496 }
36497 MAG_CAL_REPORT_DATA::ID => {
36498 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
36499 }
36500 MANUAL_CONTROL_DATA::ID => {
36501 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
36502 }
36503 MANUAL_SETPOINT_DATA::ID => {
36504 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
36505 }
36506 MEMORY_VECT_DATA::ID => {
36507 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
36508 }
36509 MESSAGE_INTERVAL_DATA::ID => {
36510 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
36511 }
36512 MISSION_ACK_DATA::ID => {
36513 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
36514 }
36515 MISSION_CLEAR_ALL_DATA::ID => {
36516 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
36517 }
36518 MISSION_COUNT_DATA::ID => {
36519 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
36520 }
36521 MISSION_CURRENT_DATA::ID => {
36522 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
36523 }
36524 MISSION_ITEM_DATA::ID => {
36525 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
36526 }
36527 MISSION_ITEM_INT_DATA::ID => {
36528 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
36529 }
36530 MISSION_ITEM_REACHED_DATA::ID => {
36531 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
36532 }
36533 MISSION_REQUEST_DATA::ID => {
36534 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
36535 }
36536 MISSION_REQUEST_INT_DATA::ID => {
36537 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
36538 }
36539 MISSION_REQUEST_LIST_DATA::ID => {
36540 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
36541 }
36542 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
36543 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
36544 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
36545 }
36546 MISSION_SET_CURRENT_DATA::ID => {
36547 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
36548 }
36549 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
36550 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
36551 .map(Self::MISSION_WRITE_PARTIAL_LIST)
36552 }
36553 MOUNT_ORIENTATION_DATA::ID => {
36554 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
36555 }
36556 NAMED_VALUE_FLOAT_DATA::ID => {
36557 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
36558 }
36559 NAMED_VALUE_INT_DATA::ID => {
36560 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
36561 }
36562 NAV_CONTROLLER_OUTPUT_DATA::ID => {
36563 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
36564 }
36565 OBSTACLE_DISTANCE_DATA::ID => {
36566 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
36567 }
36568 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
36569 ONBOARD_COMPUTER_STATUS_DATA::ID => {
36570 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
36571 .map(Self::ONBOARD_COMPUTER_STATUS)
36572 }
36573 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
36574 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
36575 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
36576 }
36577 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
36578 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
36579 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
36580 }
36581 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
36582 .map(Self::OPEN_DRONE_ID_BASIC_ID),
36583 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
36584 .map(Self::OPEN_DRONE_ID_LOCATION),
36585 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
36586 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
36587 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
36588 }
36589 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
36590 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
36591 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
36592 }
36593 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
36594 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
36595 }
36596 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
36597 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
36598 }
36599 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
36600 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
36601 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
36602 }
36603 OPTICAL_FLOW_DATA::ID => {
36604 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
36605 }
36606 OPTICAL_FLOW_RAD_DATA::ID => {
36607 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
36608 }
36609 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
36610 .map(Self::ORBIT_EXECUTION_STATUS),
36611 PARAM_EXT_ACK_DATA::ID => {
36612 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
36613 }
36614 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
36615 .map(Self::PARAM_EXT_REQUEST_LIST),
36616 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
36617 .map(Self::PARAM_EXT_REQUEST_READ),
36618 PARAM_EXT_SET_DATA::ID => {
36619 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
36620 }
36621 PARAM_EXT_VALUE_DATA::ID => {
36622 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
36623 }
36624 PARAM_MAP_RC_DATA::ID => {
36625 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
36626 }
36627 PARAM_REQUEST_LIST_DATA::ID => {
36628 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
36629 }
36630 PARAM_REQUEST_READ_DATA::ID => {
36631 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
36632 }
36633 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
36634 PARAM_VALUE_DATA::ID => {
36635 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
36636 }
36637 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
36638 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
36639 PLAY_TUNE_V2_DATA::ID => {
36640 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
36641 }
36642 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
36643 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
36644 .map(Self::POSITION_TARGET_GLOBAL_INT)
36645 }
36646 POSITION_TARGET_LOCAL_NED_DATA::ID => {
36647 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
36648 .map(Self::POSITION_TARGET_LOCAL_NED)
36649 }
36650 POWER_STATUS_DATA::ID => {
36651 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
36652 }
36653 PROTOCOL_VERSION_DATA::ID => {
36654 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
36655 }
36656 RADIO_STATUS_DATA::ID => {
36657 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
36658 }
36659 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
36660 RAW_PRESSURE_DATA::ID => {
36661 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
36662 }
36663 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
36664 RC_CHANNELS_DATA::ID => {
36665 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
36666 }
36667 RC_CHANNELS_OVERRIDE_DATA::ID => {
36668 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
36669 }
36670 RC_CHANNELS_RAW_DATA::ID => {
36671 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
36672 }
36673 RC_CHANNELS_SCALED_DATA::ID => {
36674 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
36675 }
36676 REQUEST_DATA_STREAM_DATA::ID => {
36677 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
36678 }
36679 REQUEST_EVENT_DATA::ID => {
36680 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
36681 }
36682 RESOURCE_REQUEST_DATA::ID => {
36683 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
36684 }
36685 RESPONSE_EVENT_ERROR_DATA::ID => {
36686 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
36687 }
36688 SAFETY_ALLOWED_AREA_DATA::ID => {
36689 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
36690 }
36691 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
36692 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
36693 .map(Self::SAFETY_SET_ALLOWED_AREA)
36694 }
36695 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
36696 SCALED_IMU2_DATA::ID => {
36697 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
36698 }
36699 SCALED_IMU3_DATA::ID => {
36700 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
36701 }
36702 SCALED_PRESSURE_DATA::ID => {
36703 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
36704 }
36705 SCALED_PRESSURE2_DATA::ID => {
36706 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
36707 }
36708 SCALED_PRESSURE3_DATA::ID => {
36709 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
36710 }
36711 SERIAL_CONTROL_DATA::ID => {
36712 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
36713 }
36714 SERIAL_UDB_EXTRA_F13_DATA::ID => {
36715 SERIAL_UDB_EXTRA_F13_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F13)
36716 }
36717 SERIAL_UDB_EXTRA_F14_DATA::ID => {
36718 SERIAL_UDB_EXTRA_F14_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F14)
36719 }
36720 SERIAL_UDB_EXTRA_F15_DATA::ID => {
36721 SERIAL_UDB_EXTRA_F15_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F15)
36722 }
36723 SERIAL_UDB_EXTRA_F16_DATA::ID => {
36724 SERIAL_UDB_EXTRA_F16_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F16)
36725 }
36726 SERIAL_UDB_EXTRA_F17_DATA::ID => {
36727 SERIAL_UDB_EXTRA_F17_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F17)
36728 }
36729 SERIAL_UDB_EXTRA_F18_DATA::ID => {
36730 SERIAL_UDB_EXTRA_F18_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F18)
36731 }
36732 SERIAL_UDB_EXTRA_F19_DATA::ID => {
36733 SERIAL_UDB_EXTRA_F19_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F19)
36734 }
36735 SERIAL_UDB_EXTRA_F20_DATA::ID => {
36736 SERIAL_UDB_EXTRA_F20_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F20)
36737 }
36738 SERIAL_UDB_EXTRA_F21_DATA::ID => {
36739 SERIAL_UDB_EXTRA_F21_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F21)
36740 }
36741 SERIAL_UDB_EXTRA_F22_DATA::ID => {
36742 SERIAL_UDB_EXTRA_F22_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F22)
36743 }
36744 SERIAL_UDB_EXTRA_F2_A_DATA::ID => {
36745 SERIAL_UDB_EXTRA_F2_A_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F2_A)
36746 }
36747 SERIAL_UDB_EXTRA_F2_B_DATA::ID => {
36748 SERIAL_UDB_EXTRA_F2_B_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F2_B)
36749 }
36750 SERIAL_UDB_EXTRA_F4_DATA::ID => {
36751 SERIAL_UDB_EXTRA_F4_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F4)
36752 }
36753 SERIAL_UDB_EXTRA_F5_DATA::ID => {
36754 SERIAL_UDB_EXTRA_F5_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F5)
36755 }
36756 SERIAL_UDB_EXTRA_F6_DATA::ID => {
36757 SERIAL_UDB_EXTRA_F6_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F6)
36758 }
36759 SERIAL_UDB_EXTRA_F7_DATA::ID => {
36760 SERIAL_UDB_EXTRA_F7_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F7)
36761 }
36762 SERIAL_UDB_EXTRA_F8_DATA::ID => {
36763 SERIAL_UDB_EXTRA_F8_DATA::deser(version, payload).map(Self::SERIAL_UDB_EXTRA_F8)
36764 }
36765 SERVO_OUTPUT_RAW_DATA::ID => {
36766 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
36767 }
36768 SETUP_SIGNING_DATA::ID => {
36769 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
36770 }
36771 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
36772 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
36773 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
36774 }
36775 SET_ATTITUDE_TARGET_DATA::ID => {
36776 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
36777 }
36778 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
36779 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
36780 }
36781 SET_HOME_POSITION_DATA::ID => {
36782 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
36783 }
36784 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
36785 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
36786 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
36787 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
36788 }
36789 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
36790 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
36791 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
36792 }
36793 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
36794 SMART_BATTERY_INFO_DATA::ID => {
36795 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
36796 }
36797 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
36798 STORAGE_INFORMATION_DATA::ID => {
36799 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
36800 }
36801 SUPPORTED_TUNES_DATA::ID => {
36802 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
36803 }
36804 SYSTEM_TIME_DATA::ID => {
36805 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
36806 }
36807 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
36808 TERRAIN_CHECK_DATA::ID => {
36809 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
36810 }
36811 TERRAIN_DATA_DATA::ID => {
36812 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
36813 }
36814 TERRAIN_REPORT_DATA::ID => {
36815 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
36816 }
36817 TERRAIN_REQUEST_DATA::ID => {
36818 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
36819 }
36820 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
36821 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
36822 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
36823 .map(Self::TIME_ESTIMATE_TO_TARGET)
36824 }
36825 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
36826 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
36827 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
36828 }
36829 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
36830 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
36831 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
36832 }
36833 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
36834 UAVCAN_NODE_INFO_DATA::ID => {
36835 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
36836 }
36837 UAVCAN_NODE_STATUS_DATA::ID => {
36838 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
36839 }
36840 UTM_GLOBAL_POSITION_DATA::ID => {
36841 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
36842 }
36843 V2_EXTENSION_DATA::ID => {
36844 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
36845 }
36846 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
36847 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
36848 VICON_POSITION_ESTIMATE_DATA::ID => {
36849 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
36850 .map(Self::VICON_POSITION_ESTIMATE)
36851 }
36852 VIDEO_STREAM_INFORMATION_DATA::ID => {
36853 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
36854 .map(Self::VIDEO_STREAM_INFORMATION)
36855 }
36856 VIDEO_STREAM_STATUS_DATA::ID => {
36857 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
36858 }
36859 VISION_POSITION_ESTIMATE_DATA::ID => {
36860 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
36861 .map(Self::VISION_POSITION_ESTIMATE)
36862 }
36863 VISION_SPEED_ESTIMATE_DATA::ID => {
36864 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
36865 }
36866 WHEEL_DISTANCE_DATA::ID => {
36867 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
36868 }
36869 WIFI_CONFIG_AP_DATA::ID => {
36870 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
36871 }
36872 WINCH_STATUS_DATA::ID => {
36873 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
36874 }
36875 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
36876 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
36877 }
36878 }
36879 fn message_name(&self) -> &'static str {
36880 match self {
36881 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
36882 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
36883 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
36884 Self::AIRSPEEDS(..) => AIRSPEEDS_DATA::NAME,
36885 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
36886 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
36887 Self::ALTITUDES(..) => ALTITUDES_DATA::NAME,
36888 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
36889 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
36890 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
36891 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
36892 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
36893 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
36894 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
36895 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
36896 }
36897 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
36898 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
36899 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
36900 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
36901 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
36902 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
36903 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
36904 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
36905 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
36906 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
36907 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
36908 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
36909 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
36910 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
36911 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
36912 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
36913 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
36914 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
36915 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
36916 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
36917 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
36918 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
36919 Self::COLLISION(..) => COLLISION_DATA::NAME,
36920 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
36921 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
36922 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
36923 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
36924 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
36925 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
36926 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
36927 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
36928 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
36929 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
36930 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
36931 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
36932 Self::DEBUG(..) => DEBUG_DATA::NAME,
36933 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
36934 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
36935 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
36936 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
36937 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
36938 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
36939 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
36940 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
36941 Self::EVENT(..) => EVENT_DATA::NAME,
36942 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
36943 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
36944 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
36945 Self::FLEXIFUNCTION_BUFFER_FUNCTION(..) => FLEXIFUNCTION_BUFFER_FUNCTION_DATA::NAME,
36946 Self::FLEXIFUNCTION_BUFFER_FUNCTION_ACK(..) => {
36947 FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA::NAME
36948 }
36949 Self::FLEXIFUNCTION_COMMAND(..) => FLEXIFUNCTION_COMMAND_DATA::NAME,
36950 Self::FLEXIFUNCTION_COMMAND_ACK(..) => FLEXIFUNCTION_COMMAND_ACK_DATA::NAME,
36951 Self::FLEXIFUNCTION_DIRECTORY(..) => FLEXIFUNCTION_DIRECTORY_DATA::NAME,
36952 Self::FLEXIFUNCTION_DIRECTORY_ACK(..) => FLEXIFUNCTION_DIRECTORY_ACK_DATA::NAME,
36953 Self::FLEXIFUNCTION_READ_REQ(..) => FLEXIFUNCTION_READ_REQ_DATA::NAME,
36954 Self::FLEXIFUNCTION_SET(..) => FLEXIFUNCTION_SET_DATA::NAME,
36955 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
36956 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
36957 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
36958 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
36959 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
36960 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
36961 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
36962 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
36963 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
36964 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
36965 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
36966 }
36967 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
36968 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
36969 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
36970 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
36971 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
36972 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
36973 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
36974 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
36975 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
36976 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
36977 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
36978 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
36979 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
36980 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
36981 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
36982 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
36983 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
36984 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
36985 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
36986 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
36987 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
36988 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
36989 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
36990 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
36991 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
36992 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
36993 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
36994 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
36995 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
36996 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
36997 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
36998 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
36999 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
37000 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
37001 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
37002 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
37003 }
37004 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
37005 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
37006 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
37007 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
37008 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
37009 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
37010 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
37011 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
37012 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
37013 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
37014 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
37015 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
37016 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
37017 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
37018 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
37019 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
37020 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
37021 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
37022 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
37023 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
37024 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
37025 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
37026 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
37027 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
37028 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
37029 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
37030 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
37031 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
37032 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
37033 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
37034 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
37035 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
37036 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
37037 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
37038 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
37039 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
37040 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
37041 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
37042 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
37043 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
37044 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
37045 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
37046 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
37047 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
37048 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
37049 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
37050 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
37051 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
37052 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
37053 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
37054 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
37055 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
37056 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
37057 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
37058 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
37059 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
37060 Self::PING(..) => PING_DATA::NAME,
37061 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
37062 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
37063 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
37064 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
37065 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
37066 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
37067 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
37068 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
37069 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
37070 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
37071 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
37072 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
37073 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
37074 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
37075 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
37076 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
37077 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
37078 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
37079 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
37080 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
37081 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
37082 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
37083 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
37084 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
37085 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
37086 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
37087 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
37088 Self::SERIAL_UDB_EXTRA_F13(..) => SERIAL_UDB_EXTRA_F13_DATA::NAME,
37089 Self::SERIAL_UDB_EXTRA_F14(..) => SERIAL_UDB_EXTRA_F14_DATA::NAME,
37090 Self::SERIAL_UDB_EXTRA_F15(..) => SERIAL_UDB_EXTRA_F15_DATA::NAME,
37091 Self::SERIAL_UDB_EXTRA_F16(..) => SERIAL_UDB_EXTRA_F16_DATA::NAME,
37092 Self::SERIAL_UDB_EXTRA_F17(..) => SERIAL_UDB_EXTRA_F17_DATA::NAME,
37093 Self::SERIAL_UDB_EXTRA_F18(..) => SERIAL_UDB_EXTRA_F18_DATA::NAME,
37094 Self::SERIAL_UDB_EXTRA_F19(..) => SERIAL_UDB_EXTRA_F19_DATA::NAME,
37095 Self::SERIAL_UDB_EXTRA_F20(..) => SERIAL_UDB_EXTRA_F20_DATA::NAME,
37096 Self::SERIAL_UDB_EXTRA_F21(..) => SERIAL_UDB_EXTRA_F21_DATA::NAME,
37097 Self::SERIAL_UDB_EXTRA_F22(..) => SERIAL_UDB_EXTRA_F22_DATA::NAME,
37098 Self::SERIAL_UDB_EXTRA_F2_A(..) => SERIAL_UDB_EXTRA_F2_A_DATA::NAME,
37099 Self::SERIAL_UDB_EXTRA_F2_B(..) => SERIAL_UDB_EXTRA_F2_B_DATA::NAME,
37100 Self::SERIAL_UDB_EXTRA_F4(..) => SERIAL_UDB_EXTRA_F4_DATA::NAME,
37101 Self::SERIAL_UDB_EXTRA_F5(..) => SERIAL_UDB_EXTRA_F5_DATA::NAME,
37102 Self::SERIAL_UDB_EXTRA_F6(..) => SERIAL_UDB_EXTRA_F6_DATA::NAME,
37103 Self::SERIAL_UDB_EXTRA_F7(..) => SERIAL_UDB_EXTRA_F7_DATA::NAME,
37104 Self::SERIAL_UDB_EXTRA_F8(..) => SERIAL_UDB_EXTRA_F8_DATA::NAME,
37105 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
37106 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
37107 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
37108 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
37109 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
37110 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
37111 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
37112 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
37113 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
37114 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
37115 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
37116 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
37117 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
37118 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
37119 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
37120 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
37121 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
37122 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
37123 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
37124 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
37125 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
37126 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
37127 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
37128 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
37129 }
37130 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
37131 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
37132 }
37133 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
37134 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
37135 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
37136 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
37137 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
37138 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
37139 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
37140 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
37141 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
37142 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
37143 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
37144 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
37145 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
37146 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
37147 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
37148 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
37149 }
37150 }
37151 fn message_id(&self) -> u32 {
37152 match self {
37153 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
37154 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
37155 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
37156 Self::AIRSPEEDS(..) => AIRSPEEDS_DATA::ID,
37157 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
37158 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
37159 Self::ALTITUDES(..) => ALTITUDES_DATA::ID,
37160 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
37161 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
37162 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
37163 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
37164 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
37165 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
37166 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
37167 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
37168 }
37169 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
37170 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
37171 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
37172 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
37173 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
37174 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
37175 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
37176 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
37177 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
37178 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
37179 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
37180 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
37181 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
37182 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
37183 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
37184 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
37185 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
37186 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
37187 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
37188 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
37189 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
37190 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
37191 Self::COLLISION(..) => COLLISION_DATA::ID,
37192 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
37193 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
37194 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
37195 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
37196 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
37197 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
37198 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
37199 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
37200 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
37201 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
37202 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
37203 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
37204 Self::DEBUG(..) => DEBUG_DATA::ID,
37205 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
37206 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
37207 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
37208 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
37209 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
37210 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
37211 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
37212 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
37213 Self::EVENT(..) => EVENT_DATA::ID,
37214 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
37215 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
37216 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
37217 Self::FLEXIFUNCTION_BUFFER_FUNCTION(..) => FLEXIFUNCTION_BUFFER_FUNCTION_DATA::ID,
37218 Self::FLEXIFUNCTION_BUFFER_FUNCTION_ACK(..) => {
37219 FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA::ID
37220 }
37221 Self::FLEXIFUNCTION_COMMAND(..) => FLEXIFUNCTION_COMMAND_DATA::ID,
37222 Self::FLEXIFUNCTION_COMMAND_ACK(..) => FLEXIFUNCTION_COMMAND_ACK_DATA::ID,
37223 Self::FLEXIFUNCTION_DIRECTORY(..) => FLEXIFUNCTION_DIRECTORY_DATA::ID,
37224 Self::FLEXIFUNCTION_DIRECTORY_ACK(..) => FLEXIFUNCTION_DIRECTORY_ACK_DATA::ID,
37225 Self::FLEXIFUNCTION_READ_REQ(..) => FLEXIFUNCTION_READ_REQ_DATA::ID,
37226 Self::FLEXIFUNCTION_SET(..) => FLEXIFUNCTION_SET_DATA::ID,
37227 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
37228 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
37229 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
37230 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
37231 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
37232 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
37233 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
37234 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
37235 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
37236 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
37237 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
37238 }
37239 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
37240 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
37241 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
37242 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
37243 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
37244 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
37245 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
37246 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
37247 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
37248 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
37249 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
37250 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
37251 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
37252 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
37253 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
37254 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
37255 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
37256 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
37257 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
37258 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
37259 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
37260 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
37261 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
37262 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
37263 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
37264 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
37265 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
37266 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
37267 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
37268 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
37269 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
37270 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
37271 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
37272 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
37273 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
37274 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
37275 }
37276 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
37277 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
37278 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
37279 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
37280 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
37281 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
37282 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
37283 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
37284 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
37285 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
37286 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
37287 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
37288 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
37289 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
37290 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
37291 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
37292 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
37293 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
37294 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
37295 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
37296 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
37297 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
37298 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
37299 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
37300 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
37301 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
37302 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
37303 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
37304 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
37305 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
37306 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
37307 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
37308 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
37309 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
37310 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
37311 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
37312 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
37313 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
37314 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
37315 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
37316 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
37317 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
37318 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
37319 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
37320 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
37321 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
37322 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
37323 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
37324 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
37325 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
37326 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
37327 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
37328 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
37329 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
37330 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
37331 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
37332 Self::PING(..) => PING_DATA::ID,
37333 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
37334 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
37335 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
37336 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
37337 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
37338 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
37339 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
37340 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
37341 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
37342 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
37343 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
37344 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
37345 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
37346 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
37347 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
37348 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
37349 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
37350 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
37351 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
37352 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
37353 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
37354 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
37355 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
37356 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
37357 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
37358 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
37359 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
37360 Self::SERIAL_UDB_EXTRA_F13(..) => SERIAL_UDB_EXTRA_F13_DATA::ID,
37361 Self::SERIAL_UDB_EXTRA_F14(..) => SERIAL_UDB_EXTRA_F14_DATA::ID,
37362 Self::SERIAL_UDB_EXTRA_F15(..) => SERIAL_UDB_EXTRA_F15_DATA::ID,
37363 Self::SERIAL_UDB_EXTRA_F16(..) => SERIAL_UDB_EXTRA_F16_DATA::ID,
37364 Self::SERIAL_UDB_EXTRA_F17(..) => SERIAL_UDB_EXTRA_F17_DATA::ID,
37365 Self::SERIAL_UDB_EXTRA_F18(..) => SERIAL_UDB_EXTRA_F18_DATA::ID,
37366 Self::SERIAL_UDB_EXTRA_F19(..) => SERIAL_UDB_EXTRA_F19_DATA::ID,
37367 Self::SERIAL_UDB_EXTRA_F20(..) => SERIAL_UDB_EXTRA_F20_DATA::ID,
37368 Self::SERIAL_UDB_EXTRA_F21(..) => SERIAL_UDB_EXTRA_F21_DATA::ID,
37369 Self::SERIAL_UDB_EXTRA_F22(..) => SERIAL_UDB_EXTRA_F22_DATA::ID,
37370 Self::SERIAL_UDB_EXTRA_F2_A(..) => SERIAL_UDB_EXTRA_F2_A_DATA::ID,
37371 Self::SERIAL_UDB_EXTRA_F2_B(..) => SERIAL_UDB_EXTRA_F2_B_DATA::ID,
37372 Self::SERIAL_UDB_EXTRA_F4(..) => SERIAL_UDB_EXTRA_F4_DATA::ID,
37373 Self::SERIAL_UDB_EXTRA_F5(..) => SERIAL_UDB_EXTRA_F5_DATA::ID,
37374 Self::SERIAL_UDB_EXTRA_F6(..) => SERIAL_UDB_EXTRA_F6_DATA::ID,
37375 Self::SERIAL_UDB_EXTRA_F7(..) => SERIAL_UDB_EXTRA_F7_DATA::ID,
37376 Self::SERIAL_UDB_EXTRA_F8(..) => SERIAL_UDB_EXTRA_F8_DATA::ID,
37377 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
37378 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
37379 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
37380 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
37381 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
37382 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
37383 Self::SET_MODE(..) => SET_MODE_DATA::ID,
37384 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
37385 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
37386 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
37387 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
37388 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
37389 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
37390 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
37391 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
37392 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
37393 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
37394 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
37395 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
37396 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
37397 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
37398 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
37399 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
37400 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
37401 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
37402 }
37403 Self::TUNNEL(..) => TUNNEL_DATA::ID,
37404 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
37405 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
37406 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
37407 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
37408 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
37409 Self::VIBRATION(..) => VIBRATION_DATA::ID,
37410 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
37411 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
37412 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
37413 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
37414 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
37415 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
37416 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
37417 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
37418 Self::WIND_COV(..) => WIND_COV_DATA::ID,
37419 }
37420 }
37421 fn message_id_from_name(name: &str) -> Option<u32> {
37422 match name {
37423 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
37424 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
37425 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
37426 AIRSPEEDS_DATA::NAME => Some(AIRSPEEDS_DATA::ID),
37427 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
37428 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
37429 ALTITUDES_DATA::NAME => Some(ALTITUDES_DATA::ID),
37430 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
37431 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
37432 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
37433 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
37434 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
37435 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
37436 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
37437 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
37438 }
37439 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
37440 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
37441 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
37442 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
37443 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
37444 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
37445 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
37446 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
37447 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
37448 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
37449 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
37450 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
37451 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
37452 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
37453 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
37454 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
37455 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
37456 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
37457 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
37458 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
37459 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
37460 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
37461 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
37462 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
37463 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
37464 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
37465 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
37466 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
37467 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
37468 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
37469 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
37470 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
37471 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
37472 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
37473 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
37474 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
37475 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
37476 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
37477 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
37478 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
37479 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
37480 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
37481 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
37482 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
37483 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
37484 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
37485 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
37486 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
37487 FLEXIFUNCTION_BUFFER_FUNCTION_DATA::NAME => {
37488 Some(FLEXIFUNCTION_BUFFER_FUNCTION_DATA::ID)
37489 }
37490 FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA::NAME => {
37491 Some(FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA::ID)
37492 }
37493 FLEXIFUNCTION_COMMAND_DATA::NAME => Some(FLEXIFUNCTION_COMMAND_DATA::ID),
37494 FLEXIFUNCTION_COMMAND_ACK_DATA::NAME => Some(FLEXIFUNCTION_COMMAND_ACK_DATA::ID),
37495 FLEXIFUNCTION_DIRECTORY_DATA::NAME => Some(FLEXIFUNCTION_DIRECTORY_DATA::ID),
37496 FLEXIFUNCTION_DIRECTORY_ACK_DATA::NAME => Some(FLEXIFUNCTION_DIRECTORY_ACK_DATA::ID),
37497 FLEXIFUNCTION_READ_REQ_DATA::NAME => Some(FLEXIFUNCTION_READ_REQ_DATA::ID),
37498 FLEXIFUNCTION_SET_DATA::NAME => Some(FLEXIFUNCTION_SET_DATA::ID),
37499 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
37500 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
37501 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
37502 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
37503 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
37504 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
37505 }
37506 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
37507 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
37508 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
37509 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
37510 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
37511 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
37512 }
37513 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
37514 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
37515 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
37516 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
37517 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
37518 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
37519 }
37520 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
37521 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
37522 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
37523 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
37524 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
37525 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
37526 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
37527 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
37528 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
37529 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
37530 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
37531 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
37532 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
37533 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
37534 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
37535 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
37536 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
37537 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
37538 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
37539 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
37540 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
37541 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
37542 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
37543 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
37544 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
37545 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
37546 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
37547 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
37548 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
37549 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
37550 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
37551 }
37552 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
37553 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
37554 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
37555 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
37556 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
37557 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
37558 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
37559 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
37560 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
37561 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
37562 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
37563 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
37564 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
37565 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
37566 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
37567 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
37568 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
37569 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
37570 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
37571 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
37572 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
37573 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
37574 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
37575 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
37576 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
37577 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
37578 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
37579 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
37580 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
37581 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
37582 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
37583 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
37584 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
37585 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
37586 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
37587 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
37588 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
37589 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
37590 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
37591 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
37592 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
37593 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
37594 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
37595 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
37596 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
37597 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
37598 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
37599 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
37600 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
37601 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
37602 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
37603 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
37604 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
37605 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
37606 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
37607 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
37608 PING_DATA::NAME => Some(PING_DATA::ID),
37609 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
37610 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
37611 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
37612 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
37613 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
37614 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
37615 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
37616 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
37617 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
37618 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
37619 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
37620 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
37621 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
37622 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
37623 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
37624 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
37625 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
37626 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
37627 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
37628 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
37629 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
37630 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
37631 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
37632 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
37633 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
37634 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
37635 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
37636 SERIAL_UDB_EXTRA_F13_DATA::NAME => Some(SERIAL_UDB_EXTRA_F13_DATA::ID),
37637 SERIAL_UDB_EXTRA_F14_DATA::NAME => Some(SERIAL_UDB_EXTRA_F14_DATA::ID),
37638 SERIAL_UDB_EXTRA_F15_DATA::NAME => Some(SERIAL_UDB_EXTRA_F15_DATA::ID),
37639 SERIAL_UDB_EXTRA_F16_DATA::NAME => Some(SERIAL_UDB_EXTRA_F16_DATA::ID),
37640 SERIAL_UDB_EXTRA_F17_DATA::NAME => Some(SERIAL_UDB_EXTRA_F17_DATA::ID),
37641 SERIAL_UDB_EXTRA_F18_DATA::NAME => Some(SERIAL_UDB_EXTRA_F18_DATA::ID),
37642 SERIAL_UDB_EXTRA_F19_DATA::NAME => Some(SERIAL_UDB_EXTRA_F19_DATA::ID),
37643 SERIAL_UDB_EXTRA_F20_DATA::NAME => Some(SERIAL_UDB_EXTRA_F20_DATA::ID),
37644 SERIAL_UDB_EXTRA_F21_DATA::NAME => Some(SERIAL_UDB_EXTRA_F21_DATA::ID),
37645 SERIAL_UDB_EXTRA_F22_DATA::NAME => Some(SERIAL_UDB_EXTRA_F22_DATA::ID),
37646 SERIAL_UDB_EXTRA_F2_A_DATA::NAME => Some(SERIAL_UDB_EXTRA_F2_A_DATA::ID),
37647 SERIAL_UDB_EXTRA_F2_B_DATA::NAME => Some(SERIAL_UDB_EXTRA_F2_B_DATA::ID),
37648 SERIAL_UDB_EXTRA_F4_DATA::NAME => Some(SERIAL_UDB_EXTRA_F4_DATA::ID),
37649 SERIAL_UDB_EXTRA_F5_DATA::NAME => Some(SERIAL_UDB_EXTRA_F5_DATA::ID),
37650 SERIAL_UDB_EXTRA_F6_DATA::NAME => Some(SERIAL_UDB_EXTRA_F6_DATA::ID),
37651 SERIAL_UDB_EXTRA_F7_DATA::NAME => Some(SERIAL_UDB_EXTRA_F7_DATA::ID),
37652 SERIAL_UDB_EXTRA_F8_DATA::NAME => Some(SERIAL_UDB_EXTRA_F8_DATA::ID),
37653 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
37654 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
37655 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
37656 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
37657 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
37658 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
37659 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
37660 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
37661 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
37662 }
37663 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
37664 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
37665 }
37666 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
37667 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
37668 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
37669 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
37670 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
37671 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
37672 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
37673 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
37674 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
37675 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
37676 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
37677 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
37678 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
37679 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
37680 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
37681 }
37682 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
37683 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
37684 }
37685 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
37686 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
37687 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
37688 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
37689 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
37690 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
37691 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
37692 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
37693 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
37694 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
37695 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
37696 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
37697 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
37698 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
37699 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
37700 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
37701 _ => None,
37702 }
37703 }
37704 fn default_message_from_id(id: u32) -> Option<Self> {
37705 match id {
37706 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
37707 ACTUATOR_CONTROL_TARGET_DATA::default(),
37708 )),
37709 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
37710 ACTUATOR_OUTPUT_STATUS_DATA::default(),
37711 )),
37712 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
37713 AIRSPEEDS_DATA::ID => Some(Self::AIRSPEEDS(AIRSPEEDS_DATA::default())),
37714 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
37715 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
37716 ALTITUDES_DATA::ID => Some(Self::ALTITUDES(ALTITUDES_DATA::default())),
37717 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
37718 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
37719 ATTITUDE_QUATERNION_DATA::default(),
37720 )),
37721 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
37722 ATTITUDE_QUATERNION_COV_DATA::default(),
37723 )),
37724 ATTITUDE_TARGET_DATA::ID => {
37725 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
37726 }
37727 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
37728 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
37729 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
37730 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
37731 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
37732 ))
37733 }
37734 AUTOPILOT_VERSION_DATA::ID => {
37735 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
37736 }
37737 AVAILABLE_MODES_DATA::ID => {
37738 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
37739 }
37740 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
37741 AVAILABLE_MODES_MONITOR_DATA::default(),
37742 )),
37743 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
37744 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
37745 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
37746 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
37747 CAMERA_CAPTURE_STATUS_DATA::default(),
37748 )),
37749 CAMERA_FOV_STATUS_DATA::ID => {
37750 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
37751 }
37752 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
37753 CAMERA_IMAGE_CAPTURED_DATA::default(),
37754 )),
37755 CAMERA_INFORMATION_DATA::ID => {
37756 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
37757 }
37758 CAMERA_SETTINGS_DATA::ID => {
37759 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
37760 }
37761 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
37762 CAMERA_THERMAL_RANGE_DATA::default(),
37763 )),
37764 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
37765 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
37766 )),
37767 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
37768 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
37769 )),
37770 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
37771 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
37772 CAN_FILTER_MODIFY_DATA::ID => {
37773 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
37774 }
37775 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
37776 CELLULAR_CONFIG_DATA::ID => {
37777 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
37778 }
37779 CELLULAR_STATUS_DATA::ID => {
37780 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
37781 }
37782 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
37783 CHANGE_OPERATOR_CONTROL_DATA::default(),
37784 )),
37785 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
37786 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
37787 )),
37788 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
37789 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
37790 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
37791 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
37792 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
37793 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
37794 COMPONENT_INFORMATION_DATA::default(),
37795 )),
37796 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
37797 COMPONENT_INFORMATION_BASIC_DATA::default(),
37798 )),
37799 COMPONENT_METADATA_DATA::ID => {
37800 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
37801 }
37802 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
37803 CONTROL_SYSTEM_STATE_DATA::default(),
37804 )),
37805 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
37806 CURRENT_EVENT_SEQUENCE_DATA::default(),
37807 )),
37808 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
37809 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
37810 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
37811 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
37812 )),
37813 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
37814 DEBUG_FLOAT_ARRAY_DATA::ID => {
37815 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
37816 }
37817 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
37818 DISTANCE_SENSOR_DATA::ID => {
37819 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
37820 }
37821 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
37822 ENCAPSULATED_DATA_DATA::ID => {
37823 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
37824 }
37825 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
37826 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
37827 ESTIMATOR_STATUS_DATA::ID => {
37828 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
37829 }
37830 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
37831 EXTENDED_SYS_STATE_DATA::ID => {
37832 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
37833 }
37834 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
37835 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
37836 FILE_TRANSFER_PROTOCOL_DATA::default(),
37837 )),
37838 FLEXIFUNCTION_BUFFER_FUNCTION_DATA::ID => Some(Self::FLEXIFUNCTION_BUFFER_FUNCTION(
37839 FLEXIFUNCTION_BUFFER_FUNCTION_DATA::default(),
37840 )),
37841 FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA::ID => {
37842 Some(Self::FLEXIFUNCTION_BUFFER_FUNCTION_ACK(
37843 FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA::default(),
37844 ))
37845 }
37846 FLEXIFUNCTION_COMMAND_DATA::ID => Some(Self::FLEXIFUNCTION_COMMAND(
37847 FLEXIFUNCTION_COMMAND_DATA::default(),
37848 )),
37849 FLEXIFUNCTION_COMMAND_ACK_DATA::ID => Some(Self::FLEXIFUNCTION_COMMAND_ACK(
37850 FLEXIFUNCTION_COMMAND_ACK_DATA::default(),
37851 )),
37852 FLEXIFUNCTION_DIRECTORY_DATA::ID => Some(Self::FLEXIFUNCTION_DIRECTORY(
37853 FLEXIFUNCTION_DIRECTORY_DATA::default(),
37854 )),
37855 FLEXIFUNCTION_DIRECTORY_ACK_DATA::ID => Some(Self::FLEXIFUNCTION_DIRECTORY_ACK(
37856 FLEXIFUNCTION_DIRECTORY_ACK_DATA::default(),
37857 )),
37858 FLEXIFUNCTION_READ_REQ_DATA::ID => Some(Self::FLEXIFUNCTION_READ_REQ(
37859 FLEXIFUNCTION_READ_REQ_DATA::default(),
37860 )),
37861 FLEXIFUNCTION_SET_DATA::ID => {
37862 Some(Self::FLEXIFUNCTION_SET(FLEXIFUNCTION_SET_DATA::default()))
37863 }
37864 FLIGHT_INFORMATION_DATA::ID => {
37865 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
37866 }
37867 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
37868 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
37869 GENERATOR_STATUS_DATA::ID => {
37870 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
37871 }
37872 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
37873 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
37874 )),
37875 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
37876 GIMBAL_DEVICE_INFORMATION_DATA::default(),
37877 )),
37878 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
37879 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
37880 )),
37881 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
37882 GIMBAL_MANAGER_INFORMATION_DATA::default(),
37883 )),
37884 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
37885 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
37886 )),
37887 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
37888 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
37889 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
37890 ))
37891 }
37892 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
37893 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
37894 )),
37895 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
37896 GIMBAL_MANAGER_STATUS_DATA::default(),
37897 )),
37898 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
37899 GLOBAL_POSITION_INT_DATA::default(),
37900 )),
37901 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
37902 GLOBAL_POSITION_INT_COV_DATA::default(),
37903 )),
37904 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
37905 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
37906 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
37907 ))
37908 }
37909 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
37910 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
37911 GPS_GLOBAL_ORIGIN_DATA::ID => {
37912 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
37913 }
37914 GPS_INJECT_DATA_DATA::ID => {
37915 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
37916 }
37917 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
37918 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
37919 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
37920 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
37921 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
37922 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
37923 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
37924 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
37925 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
37926 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
37927 HIL_ACTUATOR_CONTROLS_DATA::default(),
37928 )),
37929 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
37930 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
37931 HIL_OPTICAL_FLOW_DATA::ID => {
37932 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
37933 }
37934 HIL_RC_INPUTS_RAW_DATA::ID => {
37935 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
37936 }
37937 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
37938 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
37939 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
37940 HIL_STATE_QUATERNION_DATA::default(),
37941 )),
37942 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
37943 HYGROMETER_SENSOR_DATA::ID => {
37944 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
37945 }
37946 ILLUMINATOR_STATUS_DATA::ID => {
37947 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
37948 }
37949 ISBD_LINK_STATUS_DATA::ID => {
37950 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
37951 }
37952 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
37953 LINK_NODE_STATUS_DATA::ID => {
37954 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
37955 }
37956 LOCAL_POSITION_NED_DATA::ID => {
37957 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
37958 }
37959 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
37960 LOCAL_POSITION_NED_COV_DATA::default(),
37961 )),
37962 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
37963 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
37964 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
37965 ))
37966 }
37967 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
37968 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
37969 LOGGING_DATA_ACKED_DATA::ID => {
37970 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
37971 }
37972 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
37973 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
37974 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
37975 LOG_REQUEST_DATA_DATA::ID => {
37976 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
37977 }
37978 LOG_REQUEST_END_DATA::ID => {
37979 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
37980 }
37981 LOG_REQUEST_LIST_DATA::ID => {
37982 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
37983 }
37984 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
37985 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
37986 MANUAL_SETPOINT_DATA::ID => {
37987 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
37988 }
37989 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
37990 MESSAGE_INTERVAL_DATA::ID => {
37991 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
37992 }
37993 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
37994 MISSION_CLEAR_ALL_DATA::ID => {
37995 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
37996 }
37997 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
37998 MISSION_CURRENT_DATA::ID => {
37999 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
38000 }
38001 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
38002 MISSION_ITEM_INT_DATA::ID => {
38003 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
38004 }
38005 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
38006 MISSION_ITEM_REACHED_DATA::default(),
38007 )),
38008 MISSION_REQUEST_DATA::ID => {
38009 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
38010 }
38011 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
38012 MISSION_REQUEST_INT_DATA::default(),
38013 )),
38014 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
38015 MISSION_REQUEST_LIST_DATA::default(),
38016 )),
38017 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
38018 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
38019 )),
38020 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
38021 MISSION_SET_CURRENT_DATA::default(),
38022 )),
38023 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
38024 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
38025 )),
38026 MOUNT_ORIENTATION_DATA::ID => {
38027 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
38028 }
38029 NAMED_VALUE_FLOAT_DATA::ID => {
38030 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
38031 }
38032 NAMED_VALUE_INT_DATA::ID => {
38033 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
38034 }
38035 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
38036 NAV_CONTROLLER_OUTPUT_DATA::default(),
38037 )),
38038 OBSTACLE_DISTANCE_DATA::ID => {
38039 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
38040 }
38041 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
38042 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
38043 ONBOARD_COMPUTER_STATUS_DATA::default(),
38044 )),
38045 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
38046 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
38047 )),
38048 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
38049 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
38050 )),
38051 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
38052 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
38053 )),
38054 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
38055 OPEN_DRONE_ID_LOCATION_DATA::default(),
38056 )),
38057 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
38058 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
38059 )),
38060 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
38061 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
38062 )),
38063 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
38064 OPEN_DRONE_ID_SELF_ID_DATA::default(),
38065 )),
38066 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
38067 OPEN_DRONE_ID_SYSTEM_DATA::default(),
38068 )),
38069 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
38070 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
38071 )),
38072 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
38073 OPTICAL_FLOW_RAD_DATA::ID => {
38074 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
38075 }
38076 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
38077 ORBIT_EXECUTION_STATUS_DATA::default(),
38078 )),
38079 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
38080 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
38081 PARAM_EXT_REQUEST_LIST_DATA::default(),
38082 )),
38083 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
38084 PARAM_EXT_REQUEST_READ_DATA::default(),
38085 )),
38086 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
38087 PARAM_EXT_VALUE_DATA::ID => {
38088 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
38089 }
38090 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
38091 PARAM_REQUEST_LIST_DATA::ID => {
38092 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
38093 }
38094 PARAM_REQUEST_READ_DATA::ID => {
38095 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
38096 }
38097 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
38098 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
38099 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
38100 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
38101 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
38102 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
38103 POSITION_TARGET_GLOBAL_INT_DATA::default(),
38104 )),
38105 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
38106 POSITION_TARGET_LOCAL_NED_DATA::default(),
38107 )),
38108 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
38109 PROTOCOL_VERSION_DATA::ID => {
38110 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
38111 }
38112 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
38113 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
38114 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
38115 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
38116 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
38117 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
38118 RC_CHANNELS_OVERRIDE_DATA::default(),
38119 )),
38120 RC_CHANNELS_RAW_DATA::ID => {
38121 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
38122 }
38123 RC_CHANNELS_SCALED_DATA::ID => {
38124 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
38125 }
38126 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
38127 REQUEST_DATA_STREAM_DATA::default(),
38128 )),
38129 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
38130 RESOURCE_REQUEST_DATA::ID => {
38131 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
38132 }
38133 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
38134 RESPONSE_EVENT_ERROR_DATA::default(),
38135 )),
38136 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
38137 SAFETY_ALLOWED_AREA_DATA::default(),
38138 )),
38139 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
38140 SAFETY_SET_ALLOWED_AREA_DATA::default(),
38141 )),
38142 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
38143 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
38144 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
38145 SCALED_PRESSURE_DATA::ID => {
38146 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
38147 }
38148 SCALED_PRESSURE2_DATA::ID => {
38149 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
38150 }
38151 SCALED_PRESSURE3_DATA::ID => {
38152 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
38153 }
38154 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
38155 SERIAL_UDB_EXTRA_F13_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F13(
38156 SERIAL_UDB_EXTRA_F13_DATA::default(),
38157 )),
38158 SERIAL_UDB_EXTRA_F14_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F14(
38159 SERIAL_UDB_EXTRA_F14_DATA::default(),
38160 )),
38161 SERIAL_UDB_EXTRA_F15_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F15(
38162 SERIAL_UDB_EXTRA_F15_DATA::default(),
38163 )),
38164 SERIAL_UDB_EXTRA_F16_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F16(
38165 SERIAL_UDB_EXTRA_F16_DATA::default(),
38166 )),
38167 SERIAL_UDB_EXTRA_F17_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F17(
38168 SERIAL_UDB_EXTRA_F17_DATA::default(),
38169 )),
38170 SERIAL_UDB_EXTRA_F18_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F18(
38171 SERIAL_UDB_EXTRA_F18_DATA::default(),
38172 )),
38173 SERIAL_UDB_EXTRA_F19_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F19(
38174 SERIAL_UDB_EXTRA_F19_DATA::default(),
38175 )),
38176 SERIAL_UDB_EXTRA_F20_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F20(
38177 SERIAL_UDB_EXTRA_F20_DATA::default(),
38178 )),
38179 SERIAL_UDB_EXTRA_F21_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F21(
38180 SERIAL_UDB_EXTRA_F21_DATA::default(),
38181 )),
38182 SERIAL_UDB_EXTRA_F22_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F22(
38183 SERIAL_UDB_EXTRA_F22_DATA::default(),
38184 )),
38185 SERIAL_UDB_EXTRA_F2_A_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F2_A(
38186 SERIAL_UDB_EXTRA_F2_A_DATA::default(),
38187 )),
38188 SERIAL_UDB_EXTRA_F2_B_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F2_B(
38189 SERIAL_UDB_EXTRA_F2_B_DATA::default(),
38190 )),
38191 SERIAL_UDB_EXTRA_F4_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F4(
38192 SERIAL_UDB_EXTRA_F4_DATA::default(),
38193 )),
38194 SERIAL_UDB_EXTRA_F5_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F5(
38195 SERIAL_UDB_EXTRA_F5_DATA::default(),
38196 )),
38197 SERIAL_UDB_EXTRA_F6_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F6(
38198 SERIAL_UDB_EXTRA_F6_DATA::default(),
38199 )),
38200 SERIAL_UDB_EXTRA_F7_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F7(
38201 SERIAL_UDB_EXTRA_F7_DATA::default(),
38202 )),
38203 SERIAL_UDB_EXTRA_F8_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F8(
38204 SERIAL_UDB_EXTRA_F8_DATA::default(),
38205 )),
38206 SERVO_OUTPUT_RAW_DATA::ID => {
38207 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
38208 }
38209 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
38210 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
38211 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
38212 )),
38213 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
38214 SET_ATTITUDE_TARGET_DATA::default(),
38215 )),
38216 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
38217 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
38218 )),
38219 SET_HOME_POSITION_DATA::ID => {
38220 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
38221 }
38222 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
38223 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
38224 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
38225 )),
38226 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
38227 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
38228 )),
38229 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
38230 SMART_BATTERY_INFO_DATA::ID => {
38231 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
38232 }
38233 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
38234 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
38235 STORAGE_INFORMATION_DATA::default(),
38236 )),
38237 SUPPORTED_TUNES_DATA::ID => {
38238 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
38239 }
38240 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
38241 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
38242 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
38243 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
38244 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
38245 TERRAIN_REQUEST_DATA::ID => {
38246 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
38247 }
38248 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
38249 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
38250 TIME_ESTIMATE_TO_TARGET_DATA::default(),
38251 )),
38252 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
38253 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
38254 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
38255 ))
38256 }
38257 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
38258 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
38259 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
38260 ))
38261 }
38262 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
38263 UAVCAN_NODE_INFO_DATA::ID => {
38264 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
38265 }
38266 UAVCAN_NODE_STATUS_DATA::ID => {
38267 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
38268 }
38269 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
38270 UTM_GLOBAL_POSITION_DATA::default(),
38271 )),
38272 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
38273 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
38274 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
38275 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
38276 VICON_POSITION_ESTIMATE_DATA::default(),
38277 )),
38278 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
38279 VIDEO_STREAM_INFORMATION_DATA::default(),
38280 )),
38281 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
38282 VIDEO_STREAM_STATUS_DATA::default(),
38283 )),
38284 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
38285 VISION_POSITION_ESTIMATE_DATA::default(),
38286 )),
38287 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
38288 VISION_SPEED_ESTIMATE_DATA::default(),
38289 )),
38290 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
38291 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
38292 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
38293 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
38294 _ => None,
38295 }
38296 }
38297 #[cfg(feature = "arbitrary")]
38298 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
38299 match id {
38300 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
38301 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
38302 )),
38303 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
38304 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
38305 )),
38306 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
38307 AIRSPEEDS_DATA::ID => Some(Self::AIRSPEEDS(AIRSPEEDS_DATA::random(rng))),
38308 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
38309 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
38310 ALTITUDES_DATA::ID => Some(Self::ALTITUDES(ALTITUDES_DATA::random(rng))),
38311 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
38312 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
38313 ATTITUDE_QUATERNION_DATA::random(rng),
38314 )),
38315 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
38316 ATTITUDE_QUATERNION_COV_DATA::random(rng),
38317 )),
38318 ATTITUDE_TARGET_DATA::ID => {
38319 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
38320 }
38321 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
38322 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
38323 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
38324 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
38325 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
38326 ))
38327 }
38328 AUTOPILOT_VERSION_DATA::ID => {
38329 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
38330 }
38331 AVAILABLE_MODES_DATA::ID => {
38332 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
38333 }
38334 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
38335 AVAILABLE_MODES_MONITOR_DATA::random(rng),
38336 )),
38337 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
38338 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
38339 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
38340 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
38341 CAMERA_CAPTURE_STATUS_DATA::random(rng),
38342 )),
38343 CAMERA_FOV_STATUS_DATA::ID => {
38344 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
38345 }
38346 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
38347 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
38348 )),
38349 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
38350 CAMERA_INFORMATION_DATA::random(rng),
38351 )),
38352 CAMERA_SETTINGS_DATA::ID => {
38353 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
38354 }
38355 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
38356 CAMERA_THERMAL_RANGE_DATA::random(rng),
38357 )),
38358 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
38359 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
38360 )),
38361 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
38362 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
38363 )),
38364 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
38365 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
38366 CAN_FILTER_MODIFY_DATA::ID => {
38367 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
38368 }
38369 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
38370 CELLULAR_CONFIG_DATA::ID => {
38371 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
38372 }
38373 CELLULAR_STATUS_DATA::ID => {
38374 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
38375 }
38376 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
38377 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
38378 )),
38379 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
38380 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
38381 )),
38382 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
38383 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
38384 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
38385 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
38386 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
38387 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
38388 COMPONENT_INFORMATION_DATA::random(rng),
38389 )),
38390 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
38391 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
38392 )),
38393 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
38394 COMPONENT_METADATA_DATA::random(rng),
38395 )),
38396 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
38397 CONTROL_SYSTEM_STATE_DATA::random(rng),
38398 )),
38399 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
38400 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
38401 )),
38402 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
38403 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
38404 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
38405 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
38406 )),
38407 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
38408 DEBUG_FLOAT_ARRAY_DATA::ID => {
38409 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
38410 }
38411 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
38412 DISTANCE_SENSOR_DATA::ID => {
38413 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
38414 }
38415 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
38416 ENCAPSULATED_DATA_DATA::ID => {
38417 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
38418 }
38419 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
38420 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
38421 ESTIMATOR_STATUS_DATA::ID => {
38422 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
38423 }
38424 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
38425 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
38426 EXTENDED_SYS_STATE_DATA::random(rng),
38427 )),
38428 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
38429 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
38430 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
38431 )),
38432 FLEXIFUNCTION_BUFFER_FUNCTION_DATA::ID => Some(Self::FLEXIFUNCTION_BUFFER_FUNCTION(
38433 FLEXIFUNCTION_BUFFER_FUNCTION_DATA::random(rng),
38434 )),
38435 FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA::ID => {
38436 Some(Self::FLEXIFUNCTION_BUFFER_FUNCTION_ACK(
38437 FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA::random(rng),
38438 ))
38439 }
38440 FLEXIFUNCTION_COMMAND_DATA::ID => Some(Self::FLEXIFUNCTION_COMMAND(
38441 FLEXIFUNCTION_COMMAND_DATA::random(rng),
38442 )),
38443 FLEXIFUNCTION_COMMAND_ACK_DATA::ID => Some(Self::FLEXIFUNCTION_COMMAND_ACK(
38444 FLEXIFUNCTION_COMMAND_ACK_DATA::random(rng),
38445 )),
38446 FLEXIFUNCTION_DIRECTORY_DATA::ID => Some(Self::FLEXIFUNCTION_DIRECTORY(
38447 FLEXIFUNCTION_DIRECTORY_DATA::random(rng),
38448 )),
38449 FLEXIFUNCTION_DIRECTORY_ACK_DATA::ID => Some(Self::FLEXIFUNCTION_DIRECTORY_ACK(
38450 FLEXIFUNCTION_DIRECTORY_ACK_DATA::random(rng),
38451 )),
38452 FLEXIFUNCTION_READ_REQ_DATA::ID => Some(Self::FLEXIFUNCTION_READ_REQ(
38453 FLEXIFUNCTION_READ_REQ_DATA::random(rng),
38454 )),
38455 FLEXIFUNCTION_SET_DATA::ID => {
38456 Some(Self::FLEXIFUNCTION_SET(FLEXIFUNCTION_SET_DATA::random(rng)))
38457 }
38458 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
38459 FLIGHT_INFORMATION_DATA::random(rng),
38460 )),
38461 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
38462 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
38463 GENERATOR_STATUS_DATA::ID => {
38464 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
38465 }
38466 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
38467 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
38468 )),
38469 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
38470 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
38471 )),
38472 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
38473 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
38474 )),
38475 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
38476 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
38477 )),
38478 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
38479 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
38480 )),
38481 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
38482 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
38483 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
38484 ))
38485 }
38486 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
38487 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
38488 )),
38489 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
38490 GIMBAL_MANAGER_STATUS_DATA::random(rng),
38491 )),
38492 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
38493 GLOBAL_POSITION_INT_DATA::random(rng),
38494 )),
38495 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
38496 GLOBAL_POSITION_INT_COV_DATA::random(rng),
38497 )),
38498 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
38499 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
38500 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
38501 ))
38502 }
38503 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
38504 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
38505 GPS_GLOBAL_ORIGIN_DATA::ID => {
38506 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
38507 }
38508 GPS_INJECT_DATA_DATA::ID => {
38509 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
38510 }
38511 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
38512 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
38513 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
38514 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
38515 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
38516 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
38517 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
38518 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
38519 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
38520 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
38521 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
38522 )),
38523 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
38524 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
38525 HIL_OPTICAL_FLOW_DATA::ID => {
38526 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
38527 }
38528 HIL_RC_INPUTS_RAW_DATA::ID => {
38529 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
38530 }
38531 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
38532 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
38533 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
38534 HIL_STATE_QUATERNION_DATA::random(rng),
38535 )),
38536 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
38537 HYGROMETER_SENSOR_DATA::ID => {
38538 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
38539 }
38540 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
38541 ILLUMINATOR_STATUS_DATA::random(rng),
38542 )),
38543 ISBD_LINK_STATUS_DATA::ID => {
38544 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
38545 }
38546 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
38547 LINK_NODE_STATUS_DATA::ID => {
38548 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
38549 }
38550 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
38551 LOCAL_POSITION_NED_DATA::random(rng),
38552 )),
38553 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
38554 LOCAL_POSITION_NED_COV_DATA::random(rng),
38555 )),
38556 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
38557 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
38558 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
38559 ))
38560 }
38561 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
38562 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
38563 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
38564 LOGGING_DATA_ACKED_DATA::random(rng),
38565 )),
38566 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
38567 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
38568 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
38569 LOG_REQUEST_DATA_DATA::ID => {
38570 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
38571 }
38572 LOG_REQUEST_END_DATA::ID => {
38573 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
38574 }
38575 LOG_REQUEST_LIST_DATA::ID => {
38576 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
38577 }
38578 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
38579 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
38580 MANUAL_SETPOINT_DATA::ID => {
38581 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
38582 }
38583 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
38584 MESSAGE_INTERVAL_DATA::ID => {
38585 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
38586 }
38587 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
38588 MISSION_CLEAR_ALL_DATA::ID => {
38589 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
38590 }
38591 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
38592 MISSION_CURRENT_DATA::ID => {
38593 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
38594 }
38595 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
38596 MISSION_ITEM_INT_DATA::ID => {
38597 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
38598 }
38599 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
38600 MISSION_ITEM_REACHED_DATA::random(rng),
38601 )),
38602 MISSION_REQUEST_DATA::ID => {
38603 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
38604 }
38605 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
38606 MISSION_REQUEST_INT_DATA::random(rng),
38607 )),
38608 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
38609 MISSION_REQUEST_LIST_DATA::random(rng),
38610 )),
38611 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
38612 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
38613 )),
38614 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
38615 MISSION_SET_CURRENT_DATA::random(rng),
38616 )),
38617 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
38618 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
38619 )),
38620 MOUNT_ORIENTATION_DATA::ID => {
38621 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
38622 }
38623 NAMED_VALUE_FLOAT_DATA::ID => {
38624 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
38625 }
38626 NAMED_VALUE_INT_DATA::ID => {
38627 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
38628 }
38629 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
38630 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
38631 )),
38632 OBSTACLE_DISTANCE_DATA::ID => {
38633 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
38634 }
38635 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
38636 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
38637 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
38638 )),
38639 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
38640 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
38641 )),
38642 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
38643 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
38644 )),
38645 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
38646 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
38647 )),
38648 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
38649 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
38650 )),
38651 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
38652 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
38653 )),
38654 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
38655 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
38656 )),
38657 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
38658 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
38659 )),
38660 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
38661 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
38662 )),
38663 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
38664 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
38665 )),
38666 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
38667 OPTICAL_FLOW_RAD_DATA::ID => {
38668 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
38669 }
38670 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
38671 ORBIT_EXECUTION_STATUS_DATA::random(rng),
38672 )),
38673 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
38674 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
38675 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
38676 )),
38677 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
38678 PARAM_EXT_REQUEST_READ_DATA::random(rng),
38679 )),
38680 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
38681 PARAM_EXT_VALUE_DATA::ID => {
38682 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
38683 }
38684 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
38685 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
38686 PARAM_REQUEST_LIST_DATA::random(rng),
38687 )),
38688 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
38689 PARAM_REQUEST_READ_DATA::random(rng),
38690 )),
38691 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
38692 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
38693 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
38694 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
38695 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
38696 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
38697 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
38698 )),
38699 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
38700 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
38701 )),
38702 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
38703 PROTOCOL_VERSION_DATA::ID => {
38704 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
38705 }
38706 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
38707 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
38708 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
38709 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
38710 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
38711 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
38712 RC_CHANNELS_OVERRIDE_DATA::random(rng),
38713 )),
38714 RC_CHANNELS_RAW_DATA::ID => {
38715 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
38716 }
38717 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
38718 RC_CHANNELS_SCALED_DATA::random(rng),
38719 )),
38720 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
38721 REQUEST_DATA_STREAM_DATA::random(rng),
38722 )),
38723 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
38724 RESOURCE_REQUEST_DATA::ID => {
38725 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
38726 }
38727 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
38728 RESPONSE_EVENT_ERROR_DATA::random(rng),
38729 )),
38730 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
38731 SAFETY_ALLOWED_AREA_DATA::random(rng),
38732 )),
38733 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
38734 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
38735 )),
38736 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
38737 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
38738 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
38739 SCALED_PRESSURE_DATA::ID => {
38740 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
38741 }
38742 SCALED_PRESSURE2_DATA::ID => {
38743 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
38744 }
38745 SCALED_PRESSURE3_DATA::ID => {
38746 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
38747 }
38748 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
38749 SERIAL_UDB_EXTRA_F13_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F13(
38750 SERIAL_UDB_EXTRA_F13_DATA::random(rng),
38751 )),
38752 SERIAL_UDB_EXTRA_F14_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F14(
38753 SERIAL_UDB_EXTRA_F14_DATA::random(rng),
38754 )),
38755 SERIAL_UDB_EXTRA_F15_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F15(
38756 SERIAL_UDB_EXTRA_F15_DATA::random(rng),
38757 )),
38758 SERIAL_UDB_EXTRA_F16_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F16(
38759 SERIAL_UDB_EXTRA_F16_DATA::random(rng),
38760 )),
38761 SERIAL_UDB_EXTRA_F17_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F17(
38762 SERIAL_UDB_EXTRA_F17_DATA::random(rng),
38763 )),
38764 SERIAL_UDB_EXTRA_F18_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F18(
38765 SERIAL_UDB_EXTRA_F18_DATA::random(rng),
38766 )),
38767 SERIAL_UDB_EXTRA_F19_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F19(
38768 SERIAL_UDB_EXTRA_F19_DATA::random(rng),
38769 )),
38770 SERIAL_UDB_EXTRA_F20_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F20(
38771 SERIAL_UDB_EXTRA_F20_DATA::random(rng),
38772 )),
38773 SERIAL_UDB_EXTRA_F21_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F21(
38774 SERIAL_UDB_EXTRA_F21_DATA::random(rng),
38775 )),
38776 SERIAL_UDB_EXTRA_F22_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F22(
38777 SERIAL_UDB_EXTRA_F22_DATA::random(rng),
38778 )),
38779 SERIAL_UDB_EXTRA_F2_A_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F2_A(
38780 SERIAL_UDB_EXTRA_F2_A_DATA::random(rng),
38781 )),
38782 SERIAL_UDB_EXTRA_F2_B_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F2_B(
38783 SERIAL_UDB_EXTRA_F2_B_DATA::random(rng),
38784 )),
38785 SERIAL_UDB_EXTRA_F4_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F4(
38786 SERIAL_UDB_EXTRA_F4_DATA::random(rng),
38787 )),
38788 SERIAL_UDB_EXTRA_F5_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F5(
38789 SERIAL_UDB_EXTRA_F5_DATA::random(rng),
38790 )),
38791 SERIAL_UDB_EXTRA_F6_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F6(
38792 SERIAL_UDB_EXTRA_F6_DATA::random(rng),
38793 )),
38794 SERIAL_UDB_EXTRA_F7_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F7(
38795 SERIAL_UDB_EXTRA_F7_DATA::random(rng),
38796 )),
38797 SERIAL_UDB_EXTRA_F8_DATA::ID => Some(Self::SERIAL_UDB_EXTRA_F8(
38798 SERIAL_UDB_EXTRA_F8_DATA::random(rng),
38799 )),
38800 SERVO_OUTPUT_RAW_DATA::ID => {
38801 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
38802 }
38803 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
38804 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
38805 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
38806 )),
38807 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
38808 SET_ATTITUDE_TARGET_DATA::random(rng),
38809 )),
38810 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
38811 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
38812 )),
38813 SET_HOME_POSITION_DATA::ID => {
38814 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
38815 }
38816 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
38817 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
38818 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
38819 )),
38820 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
38821 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
38822 )),
38823 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
38824 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
38825 SMART_BATTERY_INFO_DATA::random(rng),
38826 )),
38827 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
38828 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
38829 STORAGE_INFORMATION_DATA::random(rng),
38830 )),
38831 SUPPORTED_TUNES_DATA::ID => {
38832 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
38833 }
38834 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
38835 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
38836 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
38837 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
38838 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
38839 TERRAIN_REQUEST_DATA::ID => {
38840 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
38841 }
38842 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
38843 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
38844 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
38845 )),
38846 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
38847 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
38848 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
38849 ))
38850 }
38851 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
38852 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
38853 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
38854 ))
38855 }
38856 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
38857 UAVCAN_NODE_INFO_DATA::ID => {
38858 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
38859 }
38860 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
38861 UAVCAN_NODE_STATUS_DATA::random(rng),
38862 )),
38863 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
38864 UTM_GLOBAL_POSITION_DATA::random(rng),
38865 )),
38866 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
38867 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
38868 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
38869 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
38870 VICON_POSITION_ESTIMATE_DATA::random(rng),
38871 )),
38872 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
38873 VIDEO_STREAM_INFORMATION_DATA::random(rng),
38874 )),
38875 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
38876 VIDEO_STREAM_STATUS_DATA::random(rng),
38877 )),
38878 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
38879 VISION_POSITION_ESTIMATE_DATA::random(rng),
38880 )),
38881 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
38882 VISION_SPEED_ESTIMATE_DATA::random(rng),
38883 )),
38884 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
38885 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
38886 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
38887 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
38888 _ => None,
38889 }
38890 }
38891 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
38892 match self {
38893 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
38894 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
38895 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
38896 Self::AIRSPEEDS(body) => body.ser(version, bytes),
38897 Self::AIS_VESSEL(body) => body.ser(version, bytes),
38898 Self::ALTITUDE(body) => body.ser(version, bytes),
38899 Self::ALTITUDES(body) => body.ser(version, bytes),
38900 Self::ATTITUDE(body) => body.ser(version, bytes),
38901 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
38902 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
38903 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
38904 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
38905 Self::AUTH_KEY(body) => body.ser(version, bytes),
38906 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
38907 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
38908 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
38909 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
38910 Self::BATTERY_INFO(body) => body.ser(version, bytes),
38911 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
38912 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
38913 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
38914 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
38915 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
38916 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
38917 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
38918 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
38919 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
38920 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
38921 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
38922 Self::CANFD_FRAME(body) => body.ser(version, bytes),
38923 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
38924 Self::CAN_FRAME(body) => body.ser(version, bytes),
38925 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
38926 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
38927 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
38928 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
38929 Self::COLLISION(body) => body.ser(version, bytes),
38930 Self::COMMAND_ACK(body) => body.ser(version, bytes),
38931 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
38932 Self::COMMAND_INT(body) => body.ser(version, bytes),
38933 Self::COMMAND_LONG(body) => body.ser(version, bytes),
38934 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
38935 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
38936 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
38937 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
38938 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
38939 Self::CURRENT_MODE(body) => body.ser(version, bytes),
38940 Self::DATA_STREAM(body) => body.ser(version, bytes),
38941 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
38942 Self::DEBUG(body) => body.ser(version, bytes),
38943 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
38944 Self::DEBUG_VECT(body) => body.ser(version, bytes),
38945 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
38946 Self::EFI_STATUS(body) => body.ser(version, bytes),
38947 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
38948 Self::ESC_INFO(body) => body.ser(version, bytes),
38949 Self::ESC_STATUS(body) => body.ser(version, bytes),
38950 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
38951 Self::EVENT(body) => body.ser(version, bytes),
38952 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
38953 Self::FENCE_STATUS(body) => body.ser(version, bytes),
38954 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
38955 Self::FLEXIFUNCTION_BUFFER_FUNCTION(body) => body.ser(version, bytes),
38956 Self::FLEXIFUNCTION_BUFFER_FUNCTION_ACK(body) => body.ser(version, bytes),
38957 Self::FLEXIFUNCTION_COMMAND(body) => body.ser(version, bytes),
38958 Self::FLEXIFUNCTION_COMMAND_ACK(body) => body.ser(version, bytes),
38959 Self::FLEXIFUNCTION_DIRECTORY(body) => body.ser(version, bytes),
38960 Self::FLEXIFUNCTION_DIRECTORY_ACK(body) => body.ser(version, bytes),
38961 Self::FLEXIFUNCTION_READ_REQ(body) => body.ser(version, bytes),
38962 Self::FLEXIFUNCTION_SET(body) => body.ser(version, bytes),
38963 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
38964 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
38965 Self::FUEL_STATUS(body) => body.ser(version, bytes),
38966 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
38967 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
38968 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
38969 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
38970 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
38971 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
38972 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
38973 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
38974 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
38975 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
38976 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
38977 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
38978 Self::GPS2_RAW(body) => body.ser(version, bytes),
38979 Self::GPS2_RTK(body) => body.ser(version, bytes),
38980 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
38981 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
38982 Self::GPS_INPUT(body) => body.ser(version, bytes),
38983 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
38984 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
38985 Self::GPS_RTK(body) => body.ser(version, bytes),
38986 Self::GPS_STATUS(body) => body.ser(version, bytes),
38987 Self::HEARTBEAT(body) => body.ser(version, bytes),
38988 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
38989 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
38990 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
38991 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
38992 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
38993 Self::HIL_GPS(body) => body.ser(version, bytes),
38994 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
38995 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
38996 Self::HIL_SENSOR(body) => body.ser(version, bytes),
38997 Self::HIL_STATE(body) => body.ser(version, bytes),
38998 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
38999 Self::HOME_POSITION(body) => body.ser(version, bytes),
39000 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
39001 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
39002 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
39003 Self::LANDING_TARGET(body) => body.ser(version, bytes),
39004 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
39005 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
39006 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
39007 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
39008 Self::LOGGING_ACK(body) => body.ser(version, bytes),
39009 Self::LOGGING_DATA(body) => body.ser(version, bytes),
39010 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
39011 Self::LOG_DATA(body) => body.ser(version, bytes),
39012 Self::LOG_ENTRY(body) => body.ser(version, bytes),
39013 Self::LOG_ERASE(body) => body.ser(version, bytes),
39014 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
39015 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
39016 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
39017 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
39018 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
39019 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
39020 Self::MEMORY_VECT(body) => body.ser(version, bytes),
39021 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
39022 Self::MISSION_ACK(body) => body.ser(version, bytes),
39023 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
39024 Self::MISSION_COUNT(body) => body.ser(version, bytes),
39025 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
39026 Self::MISSION_ITEM(body) => body.ser(version, bytes),
39027 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
39028 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
39029 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
39030 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
39031 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
39032 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
39033 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
39034 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
39035 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
39036 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
39037 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
39038 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
39039 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
39040 Self::ODOMETRY(body) => body.ser(version, bytes),
39041 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
39042 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
39043 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
39044 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
39045 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
39046 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
39047 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
39048 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
39049 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
39050 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
39051 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
39052 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
39053 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
39054 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
39055 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
39056 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
39057 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
39058 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
39059 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
39060 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
39061 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
39062 Self::PARAM_SET(body) => body.ser(version, bytes),
39063 Self::PARAM_VALUE(body) => body.ser(version, bytes),
39064 Self::PING(body) => body.ser(version, bytes),
39065 Self::PLAY_TUNE(body) => body.ser(version, bytes),
39066 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
39067 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
39068 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
39069 Self::POWER_STATUS(body) => body.ser(version, bytes),
39070 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
39071 Self::RADIO_STATUS(body) => body.ser(version, bytes),
39072 Self::RAW_IMU(body) => body.ser(version, bytes),
39073 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
39074 Self::RAW_RPM(body) => body.ser(version, bytes),
39075 Self::RC_CHANNELS(body) => body.ser(version, bytes),
39076 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
39077 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
39078 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
39079 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
39080 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
39081 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
39082 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
39083 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
39084 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
39085 Self::SCALED_IMU(body) => body.ser(version, bytes),
39086 Self::SCALED_IMU2(body) => body.ser(version, bytes),
39087 Self::SCALED_IMU3(body) => body.ser(version, bytes),
39088 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
39089 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
39090 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
39091 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
39092 Self::SERIAL_UDB_EXTRA_F13(body) => body.ser(version, bytes),
39093 Self::SERIAL_UDB_EXTRA_F14(body) => body.ser(version, bytes),
39094 Self::SERIAL_UDB_EXTRA_F15(body) => body.ser(version, bytes),
39095 Self::SERIAL_UDB_EXTRA_F16(body) => body.ser(version, bytes),
39096 Self::SERIAL_UDB_EXTRA_F17(body) => body.ser(version, bytes),
39097 Self::SERIAL_UDB_EXTRA_F18(body) => body.ser(version, bytes),
39098 Self::SERIAL_UDB_EXTRA_F19(body) => body.ser(version, bytes),
39099 Self::SERIAL_UDB_EXTRA_F20(body) => body.ser(version, bytes),
39100 Self::SERIAL_UDB_EXTRA_F21(body) => body.ser(version, bytes),
39101 Self::SERIAL_UDB_EXTRA_F22(body) => body.ser(version, bytes),
39102 Self::SERIAL_UDB_EXTRA_F2_A(body) => body.ser(version, bytes),
39103 Self::SERIAL_UDB_EXTRA_F2_B(body) => body.ser(version, bytes),
39104 Self::SERIAL_UDB_EXTRA_F4(body) => body.ser(version, bytes),
39105 Self::SERIAL_UDB_EXTRA_F5(body) => body.ser(version, bytes),
39106 Self::SERIAL_UDB_EXTRA_F6(body) => body.ser(version, bytes),
39107 Self::SERIAL_UDB_EXTRA_F7(body) => body.ser(version, bytes),
39108 Self::SERIAL_UDB_EXTRA_F8(body) => body.ser(version, bytes),
39109 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
39110 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
39111 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
39112 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
39113 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
39114 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
39115 Self::SET_MODE(body) => body.ser(version, bytes),
39116 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
39117 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
39118 Self::SIM_STATE(body) => body.ser(version, bytes),
39119 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
39120 Self::STATUSTEXT(body) => body.ser(version, bytes),
39121 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
39122 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
39123 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
39124 Self::SYS_STATUS(body) => body.ser(version, bytes),
39125 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
39126 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
39127 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
39128 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
39129 Self::TIMESYNC(body) => body.ser(version, bytes),
39130 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
39131 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
39132 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
39133 Self::TUNNEL(body) => body.ser(version, bytes),
39134 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
39135 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
39136 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
39137 Self::V2_EXTENSION(body) => body.ser(version, bytes),
39138 Self::VFR_HUD(body) => body.ser(version, bytes),
39139 Self::VIBRATION(body) => body.ser(version, bytes),
39140 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
39141 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
39142 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
39143 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
39144 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
39145 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
39146 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
39147 Self::WINCH_STATUS(body) => body.ser(version, bytes),
39148 Self::WIND_COV(body) => body.ser(version, bytes),
39149 }
39150 }
39151 fn extra_crc(id: u32) -> u8 {
39152 match id {
39153 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
39154 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
39155 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
39156 AIRSPEEDS_DATA::ID => AIRSPEEDS_DATA::EXTRA_CRC,
39157 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
39158 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
39159 ALTITUDES_DATA::ID => ALTITUDES_DATA::EXTRA_CRC,
39160 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
39161 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
39162 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
39163 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
39164 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
39165 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
39166 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
39167 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
39168 }
39169 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
39170 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
39171 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
39172 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
39173 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
39174 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
39175 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
39176 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
39177 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
39178 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
39179 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
39180 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
39181 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
39182 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
39183 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
39184 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
39185 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
39186 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
39187 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
39188 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
39189 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
39190 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
39191 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
39192 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
39193 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
39194 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
39195 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
39196 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
39197 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
39198 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
39199 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
39200 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
39201 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
39202 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
39203 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
39204 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
39205 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
39206 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
39207 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
39208 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
39209 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
39210 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
39211 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
39212 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
39213 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
39214 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
39215 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
39216 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
39217 FLEXIFUNCTION_BUFFER_FUNCTION_DATA::ID => FLEXIFUNCTION_BUFFER_FUNCTION_DATA::EXTRA_CRC,
39218 FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA::ID => {
39219 FLEXIFUNCTION_BUFFER_FUNCTION_ACK_DATA::EXTRA_CRC
39220 }
39221 FLEXIFUNCTION_COMMAND_DATA::ID => FLEXIFUNCTION_COMMAND_DATA::EXTRA_CRC,
39222 FLEXIFUNCTION_COMMAND_ACK_DATA::ID => FLEXIFUNCTION_COMMAND_ACK_DATA::EXTRA_CRC,
39223 FLEXIFUNCTION_DIRECTORY_DATA::ID => FLEXIFUNCTION_DIRECTORY_DATA::EXTRA_CRC,
39224 FLEXIFUNCTION_DIRECTORY_ACK_DATA::ID => FLEXIFUNCTION_DIRECTORY_ACK_DATA::EXTRA_CRC,
39225 FLEXIFUNCTION_READ_REQ_DATA::ID => FLEXIFUNCTION_READ_REQ_DATA::EXTRA_CRC,
39226 FLEXIFUNCTION_SET_DATA::ID => FLEXIFUNCTION_SET_DATA::EXTRA_CRC,
39227 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
39228 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
39229 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
39230 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
39231 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
39232 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
39233 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
39234 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
39235 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
39236 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
39237 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
39238 }
39239 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
39240 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
39241 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
39242 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
39243 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
39244 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
39245 }
39246 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
39247 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
39248 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
39249 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
39250 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
39251 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
39252 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
39253 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
39254 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
39255 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
39256 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
39257 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
39258 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
39259 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
39260 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
39261 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
39262 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
39263 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
39264 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
39265 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
39266 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
39267 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
39268 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
39269 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
39270 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
39271 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
39272 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
39273 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
39274 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
39275 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
39276 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
39277 }
39278 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
39279 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
39280 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
39281 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
39282 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
39283 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
39284 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
39285 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
39286 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
39287 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
39288 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
39289 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
39290 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
39291 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
39292 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
39293 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
39294 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
39295 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
39296 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
39297 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
39298 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
39299 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
39300 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
39301 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
39302 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
39303 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
39304 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
39305 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
39306 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
39307 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
39308 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
39309 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
39310 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
39311 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
39312 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
39313 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
39314 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
39315 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
39316 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
39317 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
39318 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
39319 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
39320 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
39321 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
39322 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
39323 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
39324 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
39325 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
39326 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
39327 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
39328 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
39329 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
39330 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
39331 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
39332 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
39333 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
39334 PING_DATA::ID => PING_DATA::EXTRA_CRC,
39335 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
39336 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
39337 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
39338 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
39339 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
39340 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
39341 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
39342 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
39343 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
39344 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
39345 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
39346 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
39347 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
39348 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
39349 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
39350 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
39351 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
39352 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
39353 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
39354 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
39355 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
39356 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
39357 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
39358 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
39359 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
39360 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
39361 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
39362 SERIAL_UDB_EXTRA_F13_DATA::ID => SERIAL_UDB_EXTRA_F13_DATA::EXTRA_CRC,
39363 SERIAL_UDB_EXTRA_F14_DATA::ID => SERIAL_UDB_EXTRA_F14_DATA::EXTRA_CRC,
39364 SERIAL_UDB_EXTRA_F15_DATA::ID => SERIAL_UDB_EXTRA_F15_DATA::EXTRA_CRC,
39365 SERIAL_UDB_EXTRA_F16_DATA::ID => SERIAL_UDB_EXTRA_F16_DATA::EXTRA_CRC,
39366 SERIAL_UDB_EXTRA_F17_DATA::ID => SERIAL_UDB_EXTRA_F17_DATA::EXTRA_CRC,
39367 SERIAL_UDB_EXTRA_F18_DATA::ID => SERIAL_UDB_EXTRA_F18_DATA::EXTRA_CRC,
39368 SERIAL_UDB_EXTRA_F19_DATA::ID => SERIAL_UDB_EXTRA_F19_DATA::EXTRA_CRC,
39369 SERIAL_UDB_EXTRA_F20_DATA::ID => SERIAL_UDB_EXTRA_F20_DATA::EXTRA_CRC,
39370 SERIAL_UDB_EXTRA_F21_DATA::ID => SERIAL_UDB_EXTRA_F21_DATA::EXTRA_CRC,
39371 SERIAL_UDB_EXTRA_F22_DATA::ID => SERIAL_UDB_EXTRA_F22_DATA::EXTRA_CRC,
39372 SERIAL_UDB_EXTRA_F2_A_DATA::ID => SERIAL_UDB_EXTRA_F2_A_DATA::EXTRA_CRC,
39373 SERIAL_UDB_EXTRA_F2_B_DATA::ID => SERIAL_UDB_EXTRA_F2_B_DATA::EXTRA_CRC,
39374 SERIAL_UDB_EXTRA_F4_DATA::ID => SERIAL_UDB_EXTRA_F4_DATA::EXTRA_CRC,
39375 SERIAL_UDB_EXTRA_F5_DATA::ID => SERIAL_UDB_EXTRA_F5_DATA::EXTRA_CRC,
39376 SERIAL_UDB_EXTRA_F6_DATA::ID => SERIAL_UDB_EXTRA_F6_DATA::EXTRA_CRC,
39377 SERIAL_UDB_EXTRA_F7_DATA::ID => SERIAL_UDB_EXTRA_F7_DATA::EXTRA_CRC,
39378 SERIAL_UDB_EXTRA_F8_DATA::ID => SERIAL_UDB_EXTRA_F8_DATA::EXTRA_CRC,
39379 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
39380 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
39381 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
39382 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
39383 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
39384 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
39385 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
39386 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
39387 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
39388 }
39389 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
39390 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
39391 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
39392 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
39393 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
39394 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
39395 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
39396 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
39397 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
39398 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
39399 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
39400 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
39401 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
39402 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
39403 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
39404 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
39405 }
39406 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
39407 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
39408 }
39409 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
39410 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
39411 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
39412 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
39413 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
39414 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
39415 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
39416 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
39417 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
39418 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
39419 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
39420 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
39421 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
39422 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
39423 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
39424 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
39425 _ => 0,
39426 }
39427 }
39428 fn target_system_id(&self) -> Option<u8> {
39429 match self {
39430 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
39431 Self::CANFD_FRAME(inner) => Some(inner.target_system),
39432 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
39433 Self::CAN_FRAME(inner) => Some(inner.target_system),
39434 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
39435 Self::COMMAND_ACK(inner) => Some(inner.target_system),
39436 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
39437 Self::COMMAND_INT(inner) => Some(inner.target_system),
39438 Self::COMMAND_LONG(inner) => Some(inner.target_system),
39439 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
39440 Self::FLEXIFUNCTION_BUFFER_FUNCTION(inner) => Some(inner.target_system),
39441 Self::FLEXIFUNCTION_BUFFER_FUNCTION_ACK(inner) => Some(inner.target_system),
39442 Self::FLEXIFUNCTION_COMMAND(inner) => Some(inner.target_system),
39443 Self::FLEXIFUNCTION_DIRECTORY(inner) => Some(inner.target_system),
39444 Self::FLEXIFUNCTION_DIRECTORY_ACK(inner) => Some(inner.target_system),
39445 Self::FLEXIFUNCTION_READ_REQ(inner) => Some(inner.target_system),
39446 Self::FLEXIFUNCTION_SET(inner) => Some(inner.target_system),
39447 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
39448 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
39449 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
39450 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
39451 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
39452 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
39453 Self::LOGGING_ACK(inner) => Some(inner.target_system),
39454 Self::LOGGING_DATA(inner) => Some(inner.target_system),
39455 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
39456 Self::LOG_ERASE(inner) => Some(inner.target_system),
39457 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
39458 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
39459 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
39460 Self::MISSION_ACK(inner) => Some(inner.target_system),
39461 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
39462 Self::MISSION_COUNT(inner) => Some(inner.target_system),
39463 Self::MISSION_ITEM(inner) => Some(inner.target_system),
39464 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
39465 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
39466 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
39467 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
39468 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
39469 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
39470 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
39471 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
39472 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
39473 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
39474 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
39475 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
39476 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
39477 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
39478 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
39479 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
39480 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
39481 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
39482 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
39483 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
39484 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
39485 Self::PARAM_SET(inner) => Some(inner.target_system),
39486 Self::PING(inner) => Some(inner.target_system),
39487 Self::PLAY_TUNE(inner) => Some(inner.target_system),
39488 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
39489 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
39490 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
39491 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
39492 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
39493 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
39494 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
39495 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
39496 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
39497 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
39498 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
39499 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
39500 Self::SET_MODE(inner) => Some(inner.target_system),
39501 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
39502 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
39503 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
39504 Self::TIMESYNC(inner) => Some(inner.target_system),
39505 Self::TUNNEL(inner) => Some(inner.target_system),
39506 Self::V2_EXTENSION(inner) => Some(inner.target_system),
39507 _ => None,
39508 }
39509 }
39510 fn target_component_id(&self) -> Option<u8> {
39511 match self {
39512 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
39513 Self::CANFD_FRAME(inner) => Some(inner.target_component),
39514 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
39515 Self::CAN_FRAME(inner) => Some(inner.target_component),
39516 Self::COMMAND_ACK(inner) => Some(inner.target_component),
39517 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
39518 Self::COMMAND_INT(inner) => Some(inner.target_component),
39519 Self::COMMAND_LONG(inner) => Some(inner.target_component),
39520 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
39521 Self::FLEXIFUNCTION_BUFFER_FUNCTION(inner) => Some(inner.target_component),
39522 Self::FLEXIFUNCTION_BUFFER_FUNCTION_ACK(inner) => Some(inner.target_component),
39523 Self::FLEXIFUNCTION_COMMAND(inner) => Some(inner.target_component),
39524 Self::FLEXIFUNCTION_DIRECTORY(inner) => Some(inner.target_component),
39525 Self::FLEXIFUNCTION_DIRECTORY_ACK(inner) => Some(inner.target_component),
39526 Self::FLEXIFUNCTION_READ_REQ(inner) => Some(inner.target_component),
39527 Self::FLEXIFUNCTION_SET(inner) => Some(inner.target_component),
39528 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
39529 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
39530 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
39531 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
39532 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
39533 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
39534 Self::LOGGING_ACK(inner) => Some(inner.target_component),
39535 Self::LOGGING_DATA(inner) => Some(inner.target_component),
39536 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
39537 Self::LOG_ERASE(inner) => Some(inner.target_component),
39538 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
39539 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
39540 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
39541 Self::MISSION_ACK(inner) => Some(inner.target_component),
39542 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
39543 Self::MISSION_COUNT(inner) => Some(inner.target_component),
39544 Self::MISSION_ITEM(inner) => Some(inner.target_component),
39545 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
39546 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
39547 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
39548 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
39549 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
39550 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
39551 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
39552 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
39553 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
39554 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
39555 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
39556 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
39557 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
39558 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
39559 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
39560 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
39561 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
39562 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
39563 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
39564 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
39565 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
39566 Self::PARAM_SET(inner) => Some(inner.target_component),
39567 Self::PING(inner) => Some(inner.target_component),
39568 Self::PLAY_TUNE(inner) => Some(inner.target_component),
39569 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
39570 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
39571 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
39572 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
39573 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
39574 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
39575 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
39576 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
39577 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
39578 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
39579 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
39580 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
39581 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
39582 Self::TIMESYNC(inner) => Some(inner.target_component),
39583 Self::TUNNEL(inner) => Some(inner.target_component),
39584 Self::V2_EXTENSION(inner) => Some(inner.target_component),
39585 _ => None,
39586 }
39587 }
39588}